test: fix up N-API error test#20487
Closed
gabrielschulhof wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
BridgeAR
approved these changes
May 3, 2018
Member
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM, I suggest to keep assert.throws nevertheless.
test/addons-napi/test_error/test.js
Outdated
Member
There was a problem hiding this comment.
It is possible to use assert.throws when using the following notation:
assert.throws(
() => test_error.throwArbitrary(value),
(err) => {
assert.strictEqual(err, value);
return true;
}
);
This was referenced May 3, 2018
986c6ec to
cc09cb2
Compare
Contributor
Author
|
@BridgeAR I updated the check as you suggested. |
cjihrig
approved these changes
May 3, 2018
jasnell
approved these changes
May 3, 2018
Contributor
Author
Replace assert.throws() with an explicit try/catch in order to catch the thrown value and be able to compare it strictly to an expected value. Re: nodejs#20428 (comment)
cc09cb2 to
cfaec6e
Compare
Contributor
Author
|
sigh ... linter ... new CI: https://ci.nodejs.org/job/node-test-pull-request/14658/ |
Member
|
Please +1 if you are fine with fast tracking. |
trivikr
approved these changes
May 5, 2018
Member
|
Landed in 3b60fc2 |
addaleax
pushed a commit
that referenced
this pull request
May 5, 2018
Replace assert.throws() with an explicit try/catch in order to catch the thrown value and be able to compare it strictly to an expected value. Re: #20428 (comment) PR-URL: #20487 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
May 8, 2018
Replace assert.throws() with an explicit try/catch in order to catch the thrown value and be able to compare it strictly to an expected value. Re: #20428 (comment) PR-URL: #20487 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
May 8, 2018
Replace assert.throws() with an explicit try/catch in order to catch the thrown value and be able to compare it strictly to an expected value. Re: #20428 (comment) PR-URL: #20487 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
May 9, 2018
Replace assert.throws() with an explicit try/catch in order to catch the thrown value and be able to compare it strictly to an expected value. Re: #20428 (comment) PR-URL: #20487 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace assert.throws() with an explicit try/catch in order to catch
the thrown value and be able to compare it strictly to an expected
value.
Re: #20428 (comment)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes