Skip to content

Instantly share code, notes, and snippets.

@tniezurawski
Last active June 19, 2018 12:50
Show Gist options
  • Save tniezurawski/907d0fa83a7a621146add3871d1827ca to your computer and use it in GitHub Desktop.
Save tniezurawski/907d0fa83a7a621146add3871d1827ca to your computer and use it in GitHub Desktop.
ember-test never terminates with COVERAGE=true
// tests/helpers/close-mirage.js
export function closeMirage(hooks) {
hooks.afterEach(function () {
if (window.server) { // close Mirage Server if present
window.server.shutdown();
}
});
}
// tests/integration/modules/components/custom/custom-button
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { closeMirage } from 'PROJECT-NAME/tests/helpers/close-mirage'; // change PROJECT-NAME
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | custom/custom button', function(hooks) {
setupRenderingTest(hooks);
closeMirage(hooks); // <-- closing mirage via common helper
test('it renders', async function(assert) {
// ...
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment