-
Notifications
You must be signed in to change notification settings - Fork 779
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
Assert: Add alias for throws called 'raises' #675
Conversation
It's not necessary; jsHint haven't barked on |
// Provide an alternative to assert.throws(), for enviroments that consider throws a reserved word | ||
(function() { | ||
/*jshint sub:true */ | ||
Assert.prototype.raises = Assert.prototype[ "throws" ]; |
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.
based on what I got from #663, we should entirely replace throws
for raises
and invert the statement above to create a backwards compatibility copy of the main raises
into throws
, making the former a deprecated method until 2.0.0.
I'm not using dot notation to make the code compile in problematic environments, where Also I updated this to mention the problematic envs we know about (2nd commit). |
@leobalter @JamesMGreene anything else? |
Since you extracted the assertion tests, please be sure to update the Gruntfile to run that test script on Node as well ("test-on-node" task). Other than that, LGTM. |
Brings back the original method name, for compatibility with environments that consider 'throws' a reserved word. Fixes qunitjs#663 Closes qunitjs#675
Updated. Edited first commit and squashed the third one into the second. This should be good to land as-is. |
LGTM. |
Brings back the original method name, for compatibility with environments that consider 'throws' a reserved word.
Fixes #663
Also moves some tests for assert to its own file, in a separate commit. The new raises test is at the end of
test/assert.js
.The jshint exception is necessary to make it shut up about
assert[ "throws" ]
not using dot notation.