-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: added msg verification on assert.throws #10890
Conversation
assert.throws(makeBlock(a.deepEqual, /a/i, /a/)); | ||
assert.throws(makeBlock(a.deepEqual, /a/m, /a/)); | ||
assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im)); | ||
assert.throws(makeBlock(a.deepEqual, /ab/, /a/), /\/ab\/ deepEqual \/a\//); |
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.
Would be great if the regexp matched the full error message start to finish, so more like this:
/^AssertionError: \/ab\/ deepEqual \/a\/$/
Added changes from last review from @Trott. |
assert.throws(makeBlock(a.deepEqual, /a/i, /a/)); | ||
assert.throws(makeBlock(a.deepEqual, /a/m, /a/)); | ||
assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im)); | ||
assert.throws(makeBlock(a.deepEqual, /ab/, /a/), |
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.
Sorry, can you add $
to the end of the regular expressions.
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.
This is done!
Note: The string representation of a regexp reorders the modifiers.
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: nodejs#10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in 3e7a414. |
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: nodejs#10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: nodejs#10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: nodejs#10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: nodejs#10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: #10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: #10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: #10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add regular expression for error message validation to instances of assert.throws() in test-assert.js. PR-URL: #10890 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Note: The string representation of a regexp reorders the modifiers.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
tests