{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember-qunit/issues/113","repository_url":"https://api.github.com/repos/emberjs/ember-qunit","labels_url":"https://api.github.com/repos/emberjs/ember-qunit/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember-qunit/issues/113/comments","events_url":"https://api.github.com/repos/emberjs/ember-qunit/issues/113/events","html_url":"https://github.com/emberjs/ember-qunit/issues/113","id":51097201,"number":113,"title":"Teardown with App.destroy","user":{"login":"theworkerant","id":58770,"avatar_url":"https://avatars1.githubusercontent.com/u/58770?v=3","gravatar_id":"","url":"https://api.github.com/users/theworkerant","html_url":"https://github.com/theworkerant","followers_url":"https://api.github.com/users/theworkerant/followers","following_url":"https://api.github.com/users/theworkerant/following{/other_user}","gists_url":"https://api.github.com/users/theworkerant/gists{/gist_id}","starred_url":"https://api.github.com/users/theworkerant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theworkerant/subscriptions","organizations_url":"https://api.github.com/users/theworkerant/orgs","repos_url":"https://api.github.com/users/theworkerant/repos","events_url":"https://api.github.com/users/theworkerant/events{/privacy}","received_events_url":"https://api.github.com/users/theworkerant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2014-12-05T13:11:26Z","updated_at":"2017-05-15T15:32:31Z","closed_at":null,"body":"I've been searching like crazy to nail down this bug, and I think it has to do with qunit setup/teardown.\n\nLoading some embedded records (`Response`s) on my `Entry` model like this:\n\n```\n    setup: ->\n      App         = startApp()\n      store       = App.__container__.lookup(\"store:main\")\n      controller  = @subject()\n\n      Ember.run ->\n        store.pushPayload \"entry\", entryFixture\n        controller.set('model', store.find('entry', entryFixture.entry.id))\n\n    teardown: -> Ember.run(App, App.destroy)\n```\n\nAnd it works fine running a single test, but on running whole suite the first one passes then I get the following:\n\n```\nSetup 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>\nSource:     \nError: 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>\n    at new Error (native)\n    at Error.EmberError (http://localhost:4300/assets/vendor.js:27425:23)\n    at Object.Ember.assert (http://localhost:4300/assets/vendor.js:17039:15)\n    at Ember.Object.extend.push (http://localhost:4300/assets/vendor.js:75059:15)\n    at http://localhost:4300/assets/vendor.js:66195:15\n    at Array.forEach (native)\n    at forEach (http://localhost:4300/assets/vendor.js:27206:32)\n    at extractEmbeddedHasMany (http://localhost:4300/assets/vendor.js:66193:7)\n    at http://localhost:4300/assets/vendor.js:66172:15\n    at http://localhost:4300/assets/vendor.js:73146:20\n```\n\nIt seems `Ember.run(App, App.destroy)` is not sufficient reset the test environment back to zero? What else might need to happen here?\n"},"comment":{"url":"https://api.github.com/repos/emberjs/ember-qunit/issues/comments/301512013","html_url":"https://github.com/emberjs/ember-qunit/issues/113#issuecomment-301512013","issue_url":"https://api.github.com/repos/emberjs/ember-qunit/issues/113","id":301512013,"user":{"login":"atomkirk","id":2091439,"avatar_url":"https://avatars0.githubusercontent.com/u/2091439?v=3","gravatar_id":"","url":"https://api.github.com/users/atomkirk","html_url":"https://github.com/atomkirk","followers_url":"https://api.github.com/users/atomkirk/followers","following_url":"https://api.github.com/users/atomkirk/following{/other_user}","gists_url":"https://api.github.com/users/atomkirk/gists{/gist_id}","starred_url":"https://api.github.com/users/atomkirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomkirk/subscriptions","organizations_url":"https://api.github.com/users/atomkirk/orgs","repos_url":"https://api.github.com/users/atomkirk/repos","events_url":"https://api.github.com/users/atomkirk/events{/privacy}","received_events_url":"https://api.github.com/users/atomkirk/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T15:32:31Z","updated_at":"2017-05-15T15:32:31Z","body":"Ok, I think I've got a little more insight to add here. Turns out my problem was default properties on services not being reset between tests. For example, I have this service:\r\n\r\n```js\r\nimport Ember from 'ember';\r\n\r\nexport default Ember.Service.extend({\r\n\r\n  items: [], // originally, I only had this without resetting it in `init`\r\n\r\n  init() {\r\n    this._super(...arguments)\r\n    this.set('items', [])\r\n  },\r\n})\r\n```\r\n\r\nOnce I explicitly reset `items` to `[]` in `init` it worked. So it appears the service is being reused between tests?"}}
{"actor":{"display_login":"atomkirk"}}