Teardown with App.destroy
See original GitHub issueI’ve been searching like crazy to nail down this bug, and I think it has to do with qunit setup/teardown.
Loading some embedded records (Response
s) on my Entry
model like this:
setup: ->
App = startApp()
store = App.__container__.lookup("store:main")
controller = @subject()
Ember.run ->
store.pushPayload "entry", entryFixture
controller.set('model', store.find('entry', entryFixture.entry.id))
teardown: -> Ember.run(App, App.destroy)
And it works fine running a single test, but on running whole suite the first one passes then I get the following:
Setup failed on Generates #sections from catalog_definitions: Assertion Failed: Expected an object as `data` in a call to `push`/`update` for flaredown@model:response: , but was <flaredown@model:response::ember387:hbi_general_wellbeing_fd088f9929639fd742a209b4b083c421>
Source:
Error: Assertion Failed: Expected an object as `data` in a call to `push`/`update` for flaredown@model:response: , but was <flaredown@model:response::ember387:hbi_general_wellbeing_fd088f9929639fd742a209b4b083c421>
at new Error (native)
at Error.EmberError (http://localhost:4300/assets/vendor.js:27425:23)
at Object.Ember.assert (http://localhost:4300/assets/vendor.js:17039:15)
at Ember.Object.extend.push (http://localhost:4300/assets/vendor.js:75059:15)
at http://localhost:4300/assets/vendor.js:66195:15
at Array.forEach (native)
at forEach (http://localhost:4300/assets/vendor.js:27206:32)
at extractEmbeddedHasMany (http://localhost:4300/assets/vendor.js:66193:7)
at http://localhost:4300/assets/vendor.js:66172:15
at http://localhost:4300/assets/vendor.js:73146:20
It seems Ember.run(App, App.destroy)
is not sufficient reset the test environment back to zero? What else might need to happen here?
Issue Analytics
- State:
- Created 9 years ago
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Destroy It Tear House Down - Apps on Google Play
Tear the house teardown destory it is a 3d based physics simulating game. Heavy game teardown mode: holding your weapon to tear office...
Read more >How to destroy an angularjs app? - Stack Overflow
Using AngularJS 1.4.0, $rootScope.$destroy() is working again (as it was broken in 1.2). Using this permits to switch between several angularJS apps:
Read more >Building Destruction on the App Store
Destroy different maps, build your own, and play with your friends and other ... down kind of like teardown mean this would become...
Read more >How do I delete/destroy a Heroku application?
Please note, deleting an application via either method is irreversible. CLI. Use the command heroku apps:destroy to permanently delete an application. For more ......
Read more >Can you destroy 100 000 000 voxels? - Teardown
Can you destroy 100 000 000 voxels? Steam achievements have arrived. View full event information here: Teardown Announcement Jun 16.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @atomkirk, here is a useful link describing the shared state issue when using arrays. https://dockyard.com/blog/2015/09/18/ember-best-practices-avoid-leaking-state-into-factories
We had similar issues with tests and moved all array initialisation in to init()
@alvinvogelzang Thanks for the suggestion. This was indeed how we fixed it in our application, except we did in the setupController hook. Thanks!