Skip to content

Commit

Permalink
Work around issue with ember-cli calling Testem.hookIntoTestFramework
Browse files Browse the repository at this point in the history
This is normally handled for folks by ember-qunit, but
@ember/test-helpers has to handle it for itself.

We need to get this fixed over in ember-cli...
  • Loading branch information
rwjblue committed Dec 4, 2020
1 parent 941f801 commit 53b1c61
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (defaults) {
testGenerator: 'qunit',
},
trees: {
vendor: null,
vendor: 'tests/dummy/vendor',
},
};

Expand Down
15 changes: 15 additions & 0 deletions tests/dummy/vendor/ember-cli/test-support-suffix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** globals runningTests */
/*
used to determine if the application should be booted immediately when `app-name.js` is evaluated
when `runningTests` the `app-name.js` file will **not** import the applications `app/app.js` and
call `Application.create(...)` on it. Additionally, applications can opt-out of this behavior by
setting `autoRun` to `false` in their `ember-cli-build.js`
*/
runningTests = true;

/*
This file overrides a file built into ember-cli's build pipeline and prevents
this built-in `Testem.hookIntoTestFramework` invocation:
https://github.com/ember-cli/ember-cli/blob/v3.20.0/lib/broccoli/test-support-suffix.js#L3-L5
*/
5 changes: 5 additions & 0 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* globals Testem */
import QUnit from 'qunit';
import { registerDeprecationHandler } from '@ember/debug';
import AbstractTestLoader from 'ember-cli-test-loader/test-support/index';
Expand Down Expand Up @@ -125,3 +126,7 @@ QUnit.assert.deprecationsInclude = function (expected) {
};

QUnit.start();

if (typeof Testem !== 'undefined') {
Testem.hookIntoTestFramework();
}

0 comments on commit 53b1c61

Please sign in to comment.