I am currently using Ember Data fixtures to drive my test environment. This is very convenient because I don’t have to worry about setting up mock AJAX requests that respond with the correct JSON to every request made during tests. However, AFAIK there is no mechanism for resetting the state of the store, so even though I reset the Ember app after every test, changes to the fixtures (after they have been loaded for the first time) persist. This is obviously not ideal, since tests are no longer sandboxed – mutating/deleting fixtures can affect later tests in the suite.
- Am I misunderstanding the purpose of Ember Data fixtures? Are they not intended to be used for testing?
- Is there a way to reset the store that I’ve been unable to find?
This fiddle illustrates my issue (you may need press run again after the page loads since the tests are run asynchronously): http://jsfiddle.net/slindberg/EPGDp/2/