I am trying to use fixtures with my acceptance tests however its causing tests to fail due to duplicate data since fixtures are re-inserted in the mirage DB every test. Is there a way to get around this or remove the fixtures every test
setupApplicationTest(hooks);
setupMirage(hooks);
hooks.beforeEach(function() {
this.server.loadFixtures();
});
Where is this code that you're showing me above coming from?
In an acceptance test, Mirage automatically starts / stops the server from an initializer it bundles in its addon under
addon/instance-initializers/ember-cli-mirage-autostart.js
:which calls:
Ember starts and stops the app between every test which means that each acceptance test automatically starts with an empty database.
If you are outside the context of an acceptance test, you need to do the start stopping yourself.
Calling shutdown after each test is vital for clearing the data