test: refactor assert.equal, update assert.throws#9914
test: refactor assert.equal, update assert.throws#9914prietoguy wants to merge 4 commits intonodejs:masterfrom
Conversation
|
The commit message's subsystem prefix should be all lowercase. |
40e7ba4 to
df3c5e1
Compare
test/parallel/test-crypto-dh.js
Outdated
| assert.throws(function() { | ||
| crypto.createDiffieHellman([0x1, 0x2]); | ||
| }); | ||
| }, /First argument should be number, string or Buffer/); |
There was a problem hiding this comment.
If you're matching the entire error, you can add ^ and $ to the regular expression.
There was a problem hiding this comment.
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.
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