Skip to content

Commit

Permalink
Merge pull request #1185 from emberjs/NullVoxPopuli-patch-1
Browse files Browse the repository at this point in the history
Document loadTests()
  • Loading branch information
NullVoxPopuli authored Dec 29, 2024
2 parents 48779a9 + 38b78c9 commit 5e3996c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions addon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ start();
Also make sure that you have set `ENV.APP.autoboot = false;` for the `test`
environment in your `config/environment.js`.

### Load Tests

In environments that use the AMD Loader, `loadTests()` will need to be called
before `start()`.

```javascript
import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import { loadTests } from 'ember-qunit/test-loader';

setApplication(Application.create(config.APP));

loadTests()
start();
```

In ESM environments, this isn't needed as import.meta.glob can load test files.

### Setup Tests

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

0 comments on commit 5e3996c

Please sign in to comment.