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

Deprecate setContext #448

Merged
merged 4 commits into from Nov 6, 2019
Merged

Deprecate setContext #448

merged 4 commits into from Nov 6, 2019

Conversation

ro0gr
Copy link
Collaborator

@ro0gr ro0gr commented Mar 1, 2019

Fixes #444

moduleForComponent + setContext was a point of much confusion for ages. With @ember/test-helpers we are able to auto-detect if it's moduleForComponent kind of test or not.

@ro0gr ro0gr force-pushed the setContext-free branch 2 times, most recently from 9636abd to 68039e9 Compare October 26, 2019 19:40
@ro0gr ro0gr changed the title [wip] Simplify execution context detection Deprecate setContext Oct 26, 2019
@ro0gr ro0gr changed the title Deprecate setContext [on hold] Deprecate setContext Oct 26, 2019
@san650 san650 mentioned this pull request Oct 26, 2019
18 tasks
@coveralls
Copy link

coveralls commented Oct 26, 2019

Coverage Status

Coverage decreased (-0.4%) to 98.41% when pulling ba26739 on ro0gr:setContext-free into 629ddd3 on san650:master.

}

if (!contextName) {
throw new Error('Can not detect test type. Please make sure you use the latest version of "@ember/test-helpers".');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs coverage

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunatelly, in added test, there are some require.unsee conflicts with https://github.com/san650/ember-cli-page-object/blob/master/tests/unit/-private/compatibility-test.js, which I could not figure out.
Removing a new test :(

to avoid setContext deprecation
since we can recognize if it's moduleForComponent
using @ember/test-helpers API

It also changes priority of execution_contexts,
so RFC268 mode becomes a default one, if supported.
@ro0gr ro0gr changed the title [on hold] Deprecate setContext Deprecate setContext Nov 5, 2019
@ro0gr ro0gr mentioned this pull request Nov 5, 2019
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 this pull request may close these issues.

ENHANCEMENT - setupPageComponentTest for hooks with easier setup with test APIs
2 participants