-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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: refactor assert.equal, update assert.throws #9914
Conversation
The commit message's subsystem prefix should be all lowercase. |
40e7ba4
to
df3c5e1
Compare
|
||
assert.throws(function() { | ||
crypto.createDiffieHellman([0x1, 0x2]); | ||
}); | ||
}, /First argument should be number, string or Buffer/); |
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.
If you're matching the entire error, you can add ^
and $
to the regular expression.
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.
Ok, will make that change. Thanks!
|
||
assert.throws(function() { | ||
crypto.createDiffieHellman([0x1, 0x2]); | ||
}); | ||
}, /^First argument should be number, string or Buffer$/); |
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.
I think you also need to add the TypeError
part or the test will fail:
/^TypeError: First argument should be number, string or Buffer$/
Thanks for the work on this! Two of the three files modified here have lint errors and one of those two fails to run successfully because of the issue identified by @lpinca. The changes in these three files are unrelated to each other for the most part, so I'm going to remove the changes to the files that are failing, run CI, and land the one file with the non-problematic changes (unless someone beats me to it and lands it first). If you want to still try to get the changes to the other two files in, that's great! Create a new branch and open a separate pull request. Thanks! |
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Kudos
@Fishrock123
@bengl
@jasnell
@cjihrig