Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified migration guide to v5.x when a project includes QUnit DOM #787

Merged
merged 2 commits into from
Dec 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Upgrading from v4.x to v5.0.0
### `qunit` and `@ember/test-helpers` dependencies

Older versions of `ember-qunit` directly depended on `qunit` and
`@ember/test-helpers`, in v5 this relationship was changed and now
`ember-qunit` has `qunit` and `@ember/test-helpers` as peer dependencies.
`@ember/test-helpers`. In v5, this relationship was changed and now
`ember-qunit` has `qunit` and `@ember/test-helpers` (v2) as peer dependencies.

In order to accomodate this change in your application you can run:
In order to accomodate this change, in your application, you can run:

```sh
# npm users
npm install --save-dev qunit "@ember/test-helpers@^2.0.0-beta.4"
npm install --save-dev qunit "@ember/test-helpers"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this section are somewhat outside of PR scope (documenting what to do for QUnit DOM).

I didn't think it'd be good to show installing the beta version when stable is now available. I can revert this change, or address it differently if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!


# yarn users
yarn add --dev qunit "@ember/test-helpers@^2.0.0-beta.4"
yarn add --dev qunit "@ember/test-helpers"
```

### DOM fixtures
Expand All @@ -49,6 +49,28 @@ snippet to your `tests/index.html` just after your `{{content-for
</div>
```

### QUnit DOM

If you use QUnit DOM, you may encounter the error message `assert.dom is not a function` when you run tests.

To address this issue, import and run QUnit DOM's `setup` function in your `test-helper.js` file:

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

//...

setup(QUnit.assert);

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

start();

//...
```

### Remove `ember-test-helpers` modules

For a long time `@ember/test-helpers` re-exported all of its modules under the `ember-test-helpers` namespace,
Expand Down