Skip to content

Commit 5e3996c

Browse files
authoredDec 29, 2024
Merge pull request #1185 from emberjs/NullVoxPopuli-patch-1
Document loadTests()
2 parents 48779a9 + 38b78c9 commit 5e3996c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎addon/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ start();
8282
Also make sure that you have set `ENV.APP.autoboot = false;` for the `test`
8383
environment in your `config/environment.js`.
8484

85+
### Load Tests
86+
87+
In environments that use the AMD Loader, `loadTests()` will need to be called
88+
before `start()`.
89+
90+
```javascript
91+
import Application from '../app';
92+
import config from '../config/environment';
93+
import { setApplication } from '@ember/test-helpers';
94+
import { start } from 'ember-qunit';
95+
import { loadTests } from 'ember-qunit/test-loader';
96+
97+
setApplication(Application.create(config.APP));
98+
99+
loadTests()
100+
start();
101+
```
102+
103+
In ESM environments, this isn't needed as import.meta.glob can load test files.
104+
85105
### Setup Tests
86106

87107
The `setupTest()` function can be used to setup a unit test for any kind

0 commit comments

Comments
 (0)