-
Notifications
You must be signed in to change notification settings - Fork 602
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
Destructuring of Ember.testing
will not work.
#1476
Labels
Comments
Found another destructuring (via GH search): Which is used: and |
FYI - This is likely to bite folks updating to the latest ember-cli-qunit version (4.1.1)... |
Thanks for the notice! |
FWIW this will also be an issue for the next release of |
bgentry
added a commit
to ember-graphql/ember-apollo-client
that referenced
this issue
Dec 17, 2017
Module destructures are evaluated at build time, but this value is changed dynamically at runtime. Avoiding the destructure is the only way to work given this behavior. See these issues: mainmatter/ember-simple-auth#1476 emberjs/ember-test-helpers#227
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just happened to notice this:
https://github.com/simplabs/ember-simple-auth/blob/c295fee9b0bab6fdf7dcfca0cb706b68415caa95/addon/mixins/application-route-mixin.js#L10
Which is used here:
https://github.com/simplabs/ember-simple-auth/blob/c295fee9b0bab6fdf7dcfca0cb706b68415caa95/addon/mixins/application-route-mixin.js#L141-L149
Ember.testing
is a getter/setter in Ember, and destructuring like this will only read its value at the time the module is evaluated. In this case,Ember.testing
will most likely befalse
when the module is evaluated, then change totrue
during the test. This behavior somewhat recently changed in emberjs/ember-test-helpers#227 (which is included in[email protected]
/[email protected]
).I believe the fix here would be to remove the destructuring, and use
Ember.testing
directly inline.The text was updated successfully, but these errors were encountered: