Mirage currently starts automatically (when not disabled in your application config) in acceptance tests only. This is because Mirage’s server boots up in an Ember initializer.
You can still start a Mirage server for your integration and unit tests with the following workaround:
// tests/integration/components/your-test.js
import { startMirage } from 'yourapp/initializers/ember-cli-mirage';
moduleForComponent('your-component', 'Integration | Component | your component', {
integration: true,
beforeEach() {
this.server = startMirage();
},
afterEach() {
this.server.shutdown();
}
});
Some notes:
dummy/initializers/ember-cli-mirage
.urlPrefix
and namespace
may require to be adapted when used with integration or unit tests.