ember-qunit

In Ember js, how to create or mock hasMany relationship in unit test

梦想与她 提交于 2019-12-09 21:41:49
问题 I'm unit-testing a model which has properties with DS.hasMany() relationships. Whenever I do the following unit-test, I keep getting this error in my test-runner: Error: Assertion Failed: All elements of a hasMany relationship must be instances of DS.Model, you passed [<Ember.Object:ember367>,<Ember.Object:ember368>] Can someone shed some light into this, please? Model: export default DS.Model.extend({ accounts: DS.hasMany('account'), servicesAccounts: DS.hasMany('services-account'), address:

Could not find module `ember-resolver` imported from `AppName/resolver Ember tests

血红的双手。 提交于 2019-12-07 02:55:03
问题 I am trying to run Ember tests and it gives this error saying Could not find module ember-resolver imported from `AppName/resolver. I am not sure what is causing it. I am using Ember-cli-2.12.1. Any help would be appreciated. Thanks 回答1: I am answering this since i have resolved it and if someone come across this issue then they can solve it. Steps i did to resolve it. npm cache clear && bower cache clean && rm -rf node_modules bower_components && npm install && bower install cleaned and

Ember upgrade breaks one test, and only in Safari

試著忘記壹切 提交于 2019-12-06 16:35:59
问题 I'm trying to catch a Heisenbug. I'm updating our project from Ember CLI 0.2.0 and Ember 1.10.0 to Ember CLI 0.2.3 and Ember 1.11.1. This has been a pretty pain-free process, but I have exactly one test which now fails in Safari (7.1.5) only. It passes in PhantomJS, Chrome and Firefox. Annoyingly, the test only fails when the test run is initiated by Testem (that is, when a change in the code triggers an auto-update test run). If I initiate tests from inside the Qunit web interface, it passes

Could not find module `ember-resolver` imported from `AppName/resolver Ember tests

拟墨画扇 提交于 2019-12-05 07:24:28
I am trying to run Ember tests and it gives this error saying Could not find module ember-resolver imported from `AppName/resolver. I am not sure what is causing it. I am using Ember-cli-2.12.1. Any help would be appreciated. Thanks Sandeep I am answering this since i have resolved it and if someone come across this issue then they can solve it. Steps i did to resolve it. npm cache clear && bower cache clean && rm -rf node_modules bower_components && npm install && bower install cleaned and reinstall Bower component and npm component. ember init Then I started getting error saying could not

In Ember js, how to create or mock hasMany relationship in unit test

拜拜、爱过 提交于 2019-12-04 17:07:32
I'm unit-testing a model which has properties with DS.hasMany() relationships. Whenever I do the following unit-test, I keep getting this error in my test-runner: Error: Assertion Failed: All elements of a hasMany relationship must be instances of DS.Model, you passed [<Ember.Object:ember367>,<Ember.Object:ember368>] Can someone shed some light into this, please? Model: export default DS.Model.extend({ accounts: DS.hasMany('account'), servicesAccounts: DS.hasMany('services-account'), address: MF.fragment('address'), appEligibilities: MF.fragmentArray('app-eligibility'), appsForPremise: Ember