Last active
June 19, 2018 12:50
-
-
Save tniezurawski/907d0fa83a7a621146add3871d1827ca to your computer and use it in GitHub Desktop.
ember-test never terminates with COVERAGE=true
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tests/helpers/close-mirage.js | |
export function closeMirage(hooks) { | |
hooks.afterEach(function () { | |
if (window.server) { // close Mirage Server if present | |
window.server.shutdown(); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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