-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Provide better context for subject()
deprecation
#57
Conversation
@@ -37,7 +37,7 @@ export default TestModule.extend({ | |||
this.setupSteps.push(this.setupComponentUnitTest); | |||
} else { | |||
this.callbacks.subject = function() { | |||
throw new Error("component integration tests do not support `subject()`."); | |||
throw new Error("component integration tests do not support `subject()`. Instead, render the component as if it were HTML: `this.render('<my-component foo=true>');`. For more information, read: https://github.com/switchfly/ember-test-helpers/pull/38"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue I'm not sure about the language on this, or even if the suggestion is correct.
Once we nail down the language of this warning, I'd gladly add to the README's explanation on integration: true
mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the link, and suggest reading guides.emberjs.com
's Testing -> Testing Components guide?
The outcome of [emberjs#38][38] is undocumented. Raising a deprecation warning for calls to `this.subject` is a good start, but could be improved greatly. [38]: emberjs#38
@@ -46,7 +46,7 @@ export default TestModule.extend({ | |||
this.setupSteps.push(this.setupComponentUnitTest); | |||
} else { | |||
this.callbacks.subject = function() { | |||
throw new Error("component integration tests do not support `subject()`."); | |||
throw new Error("component integration tests do not support `subject()`. Instead, render the component as if it were HTML: `this.render('<my-component foo=true>');`. For more information, read: http://guides.emberjs.com/v2.2.0/testing/testing-components/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue replaced the link with http://guides.emberjs.com/v2.2.0/testing/testing-components/
Also, http://guides.emberjs.com/v2.2.0/ looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk, seems good, thank you (and sorry for crazy delay here)
Provide better context for `subject()` deprecation
The outcome of #38 is undocumented.
Raising a deprecation warning for calls to
this.subject
is a good start,but could be improved greatly.