-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
start.js
34 lines (30 loc) · 925 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import loadEmberExam from 'ember-exam/test-support/load';
import { start as qunitStart } from 'ember-qunit';
/**
* Equivalent to ember-qunit's loadTest() except this does not create a new TestLoader instance
*
* @function loadTests
* @param {*} testLoader
*/
function loadTests(testLoader) {
if (testLoader === undefined) {
throw new Error(
'A testLoader instance has not been created. You must call `loadEmberExam()` before calling `loadTest()`.',
);
}
testLoader.loadModules();
}
/**
* Ember-exam's own start function to set up EmberExamTestLoader, load tests and calls start() from
* ember-qunit
*
* @function start
* @param {*} qunitOptions
*/
export default function start(qunitOptions) {
const modifiedOptions = qunitOptions || Object.create(null);
modifiedOptions.loadTests = false;
const testLoader = loadEmberExam();
loadTests(testLoader);
qunitStart(modifiedOptions);
}