tsteuwer / ember-tracker

Easily add tracking to your ember application.
https://tsteuwer.github.io/ember-tracker
MIT License
12 stars 3 forks source link

Destructuring of `Ember.testing` will not work. #17

Closed rwjblue closed 6 years ago

rwjblue commented 6 years ago

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 be false when the module is evaluated, then change to true during the test. This behavior somewhat recently changed in https://github.com/emberjs/ember-test-helpers/pull/227 (which is included in ember-cli-qunit@4.1.0 / ember-qunit@3.0.0).

I believe the fix here would be to remove the destructuring, and use Ember.testing directly inline.

https://github.com/tsteuwer/ember-tracker/blob/2b2c86e4b96389ce61de11c9e263ebcc36ef3f87/addon/mixins/tealium-route.js#L16-L20

https://github.com/tsteuwer/ember-tracker/blob/2b2c86e4b96389ce61de11c9e263ebcc36ef3f87/addon/mixins/tealium-route.js#L38-L40

tsteuwer commented 6 years ago

Will do. Thanks for the heads up @rwjblue. I wonder why GitHub never sent me an email notification about a new issue. Lol

rwjblue commented 6 years ago

Haha, no problem! I struggle with missing notifications too...

tsteuwer commented 6 years ago

Fixed in release v0.5.2.