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

Add compatibility with ember-qunit@5 #816

Merged

Conversation

rwjblue
Copy link
Contributor

@rwjblue rwjblue commented Sep 17, 2020

In order to add support for ember-qunit@5 the primary Ember project usage pattern changes a bit:

// tests/test-helper.js
import * as QUnit from 'qunit';
import { setup } from 'qunit-dom';
//...snip...
setup(QUnit.assert);

No change is required for ember-qunit < 5 (this should not be a breaking change).

Closes #812

@rwjblue rwjblue marked this pull request as draft September 17, 2020 18:18
@scalvert
Copy link
Collaborator

Looks good so far. Thanks for implementing explicit calls vs. side-effect imports!

@scalvert
Copy link
Collaborator

scalvert commented Sep 20, 2020

What's the status of this PR, @rwjblue? Can we publish for review, or are you still poking at it?

Also, publishing ember-qunit, @ember/test-helpers, and others will require a bit of coordination. Do we have a parent issue that determines the correct order of rollout for all these releases, other than Rob's head? :)

@rwjblue
Copy link
Contributor Author

rwjblue commented Sep 21, 2020

What's the status of this PR, @rwjblue? Can we publish for review, or are you still poking at it?

I still have a few TODO's that need to be completed.

Also, publishing ember-qunit, @ember/test-helpers, and others will require a bit of coordination. Do we have a parent issue that determines the correct order of rollout for all these releases, other than Rob's head? :)

Good idea! Created ember-cli/ember-cli#9335 with the TODOs.

tsconfig.json Outdated Show resolved Hide resolved
@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch 2 times, most recently from 1178cf8 to 6f72500 Compare September 23, 2020 15:07
@scalvert scalvert force-pushed the refactor-to-export-modules-entry-point branch from 6f72500 to ce47497 Compare September 28, 2020 15:38
@scalvert
Copy link
Collaborator

Just did a rebase to fix merge conflicts.

@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch from ce47497 to 5bd9841 Compare October 6, 2020 22:24
rwjblue added a commit to rwjblue/--ember-qunit-5-sample-app that referenced this pull request Oct 6, 2020
@rwjblue
Copy link
Contributor Author

rwjblue commented Oct 6, 2020

https://github.com/rwjblue/--ember-qunit-5-sample-app is a demo app that uses the "whole new setup" and is passing.

@scalvert
Copy link
Collaborator

scalvert commented Oct 7, 2020

In terms of the API we expose to users, I'd prefer that we use the pattern that requires the hosting project to pass in QUnit to extend.

import { setup } from "qunit-dom"; 

// ...

setup(QUnit);

This will not require any special configuration from qunit-dom itself, in addition to not making any assumptions about the consumer's configuration of their project.

Thoughts?

@rwjblue
Copy link
Contributor Author

rwjblue commented Oct 8, 2020

In terms of the API we expose to users, I'd prefer that we use the pattern that requires the hosting project to pass in QUnit to extend.

Ya, agreed. That's what the current implementation does (though I need to push a commit to the demo repo above with that change in it).

@scalvert
Copy link
Collaborator

In the PR description, these two are the same thing, no?

Document a new API (still somewhat TBD, but probably import "qunit-dom" or import { setup } from "qunit-dom"; setup(QUnit);
Decide if setup should accept QUnit argument or directly import it?

@scalvert
Copy link
Collaborator

@rwjblue I updated the description to better reflect the actual final work for this PR.

@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch 2 times, most recently from 6a2b0c3 to a036016 Compare October 20, 2020 18:26
@scalvert scalvert marked this pull request as ready for review October 20, 2020 21:29
@scalvert scalvert requested a review from Turbo87 October 20, 2020 21:29
@scalvert
Copy link
Collaborator

@Turbo87 I think we've managed to get this into a decent state. The only thing we haven't done here is add automated tests that test the Ember variant with ember-qunit > 5, but @rwjblue has a repo that he's been using to manually test. How do we think we should handle this?

@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch 2 times, most recently from f74dda9 to cbc763c Compare October 20, 2020 23:09
ember-cli-build.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
ember-cli-build.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch from c742b5f to 4d03063 Compare October 21, 2020 13:46
@rwjblue rwjblue requested a review from Turbo87 October 21, 2020 13:46
@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch from 4d03063 to 1909bb4 Compare October 21, 2020 13:50
Copy link
Collaborator

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

LGTM after these minor comments are resolved. nice work! 👍

.github/workflows/ci.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
tests/dummy/config/ember-try.js Outdated Show resolved Hide resolved
@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch from 1909bb4 to 4e24695 Compare October 21, 2020 14:34
Now that we have moved to requiring the callsite to pass in
`QUnit.assert` to `setup` we no longer need `ember-auto-import` as a
dependency.
@rwjblue rwjblue force-pushed the refactor-to-export-modules-entry-point branch from 4e24695 to caf1b36 Compare October 21, 2020 20:26
@Turbo87 Turbo87 merged commit 4eee268 into mainmatter:master Oct 21, 2020
@rwjblue rwjblue deleted the refactor-to-export-modules-entry-point branch October 21, 2020 20:47
@Turbo87 Turbo87 mentioned this pull request Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility with ember-qunit@5
3 participants