Skip to content

Commit

Permalink
Adding documentation for the new API
Browse files Browse the repository at this point in the history
  • Loading branch information
scalvert authored and rwjblue committed Oct 20, 2020
1 parent c01547b commit a036016
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ or using [`yarn`](https://yarnpkg.com/):
yarn add --dev qunit-dom
```

(This is the recommended method for Ember projects.)
This is the recommended method for Ember projects using `ember-qunit` < 5.*.

### Ember projects using `ember-qunit` >= 5.*

Import and run the `setup` function in your `test-helper.js` file.

```js
// tests/test-helper.js
import { setup } from 'qunit-dom';

//...

setup(QUnit.assert);

//...
```

### `<script>` Tag

Expand Down
5 changes: 2 additions & 3 deletions lib/qunit-dom-modules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type * as QUnit from 'qunit';
import attach from './install';
import { overrideRootElement } from './root-element';

Expand All @@ -8,8 +7,8 @@ interface SetupOptions {
getRootElement?: () => Element | null;
}

export function setup(QUnit: QUnit, options: SetupOptions = {}) {
attach(QUnit.assert);
export function setup(assert: Assert, options: SetupOptions = {}) {
attach(assert);

const getRootElement =
typeof options.getRootElement === 'function'
Expand Down

0 comments on commit a036016

Please sign in to comment.