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

Incompatibility with Embroider #46

Open
patocallaghan opened this issue Feb 8, 2021 · 0 comments
Open

Incompatibility with Embroider #46

patocallaghan opened this issue Feb 8, 2021 · 0 comments

Comments

@patocallaghan
Copy link

I've been checking compatibility with Embroider and various Addons in the community and I came across that this addon is incompatible.

Specifically I was trying to add ember-try Embroider configuration to Ember Power Calendar, which uses this addon, but the tests fail on its custom assertion usage. The problem is that the custom assertions that the Power Calendar tests add aren't added to the global QUnit object.

Uncaught TypeError: assert.isDay is not a function

Doing a bit of digging I came across this issue (and PR), on the qunit-dom repo which similarly tries to add custom assertions to the global QUnit object. It appears this is no longer possible under ember-qunit v5 (migration guide) which is required to support Embroider.

tooling can no longer depend on the QUnit global to be defined

From the looks of it there appear to be a few changes that need to be made for it to work to support ember-qunit v5 (and therefore Embroider).

For example in qunit-dom, users now bootstrap the assertions in test-helper.js and pass in QUnit.assert.

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

Trying to run the tests I put together a branch which has Embroider + ember-try setup but I think to start, the repo will need be updated to use a newer ember-cli for it to work.

muziejus added a commit to muziejus/ember-leaflet that referenced this issue Sep 13, 2021
ember-cli-custom-assertions breaks with QUnit 5.0, which is an Embroider
dependency. Instead, the recommendation seems to be to define custom
assertions straight on `Qunit.assert` in `tests/test-helper.js`. See,
for example: https://spin.atomicobject.com/2016/11/11/custom-qunit-assertions/ and DockYard/ember-cli-custom-assertions#46
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

No branches or pull requests

1 participant