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

Deprecation Warning thrown Even when needs:[] is passed #195

Closed
blimmer opened this issue Feb 5, 2017 · 2 comments
Closed

Deprecation Warning thrown Even when needs:[] is passed #195

blimmer opened this issue Feb 5, 2017 · 2 comments
Labels

Comments

@blimmer
Copy link
Contributor

blimmer commented Feb 5, 2017

I first noticed this and reported it upstream with ember-mocha (emberjs/ember-mocha#129), but I think it's actually an issue with a change made to test-module-for-component.

This issue doesn't show with current ember-qunit and ember-test-helpers

├─┬ ember-cli-qunit@2.2.5
│ └─┬ ember-qunit@0.4.22
│   └── ember-test-helpers@0.5.34

but between 0.5.34 and 0.6.x, a call to super was added before checking the options passed:

super('component:' + componentName, description, callbacks);

This call mutates the options hash and deletes the needs key:

delete this.callbacks.needs;

Which then causes the deprecation to fire:

Ember.deprecate(
"the component:" + componentName + " test module is implicitly running in unit test mode, " +
"which will change to integration test mode by default in an upcoming version of " +
"ember-test-helpers. Add `unit: true` or a `needs:[]` list to explicitly opt in to unit " +
"test mode.",
false,
{ id: 'ember-test-helpers.test-module-for-component.test-type', until: '0.6.0' }
);

I have a proof of concept exposing this error here:

https://github.com/blimmer/ember-cli-example-app-for-github/compare/ember-mocha/issue-129

I'm not sure what the right fix is, maybe moving the call to super below the checks?

@blimmer blimmer changed the title Deprecation Warning Thrown Even when needs:[] is passed Deprecation Warning thrown Even when needs:[] is passed Feb 5, 2017
@rwjblue
Copy link
Member

rwjblue commented Feb 5, 2017

Thanks for the detailed write up, will try to poke at this tomorrow...

@Turbo87
Copy link
Member

Turbo87 commented Feb 6, 2017

@blimmer the issue with calling super() later is that you have no access to this before the super() call happened and that's also the reason why I had to move the call.

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

No branches or pull requests

3 participants