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

Avoiding Testem.hookIntoTestFramework() invocation with ember-qunit@5.0.0-beta.3+ #530

Closed
rwjblue opened this issue Sep 16, 2020 · 1 comment · Fixed by #531
Closed

Avoiding Testem.hookIntoTestFramework() invocation with ember-qunit@5.0.0-beta.3+ #530

rwjblue opened this issue Sep 16, 2020 · 1 comment · Fixed by #531

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented Sep 16, 2020

As ember-qunit is progressing towards its 5.0.0 release, I'd like to ensure that it is compatible with Embroider. The goal of that release is to play nicely with the goals of Embroider. Some of the major changes there:

  • Move qunit and @ember/test-helpers to be peerDependencies (along with validation that the app provides them)
  • Remove usage of content-for to emit the DOM structure required for tests/index.html (instead have it included in the file normally)
  • Avoid app.importing any JavaScript assets (including qunit itself and our custom configuration)

Part of the issue that we run into with the last item above is that qunit is no longer evaluated directly in the root of the test-support.js file, it is now in a module (by way of either ember-auto-import or Embroider magic). Unfortunately, both ember-cli and Embroider have baked in the assumption that by the end of test-support.js window.QUnit will be defined. This is no longer true as of ember-qunit@5.0.0-beta.3.

Specifically, the issue is in this Embroider code:

if (window.Testem) {
window.Testem.hookIntoTestFramework();
}`,

223e0cf (#752) is specifically working around this issue in a classic ember-cli build pipeline (by emitting a vendor/ember-cli/test-support-suffix.js that no longer contains the Testem.hookIntoTestFramework() invocation which clobbers the one provided by ember-cli itself). Obviously that work around doesn't work here (and its clearly haxxxors anyways).

@rwjblue
Copy link
Collaborator Author

rwjblue commented Sep 16, 2020

#531 seems like the simplest fix (and one that I can land in ember-cli itself also), what do you think @ef4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant