We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17e4c8b commit 21f0577Copy full SHA for 21f0577
test/addons-napi/test_error/test.js
@@ -61,16 +61,23 @@ assert.throws(() => {
61
}, /^TypeError: type error$/);
62
63
function testThrowArbitrary(value) {
64
- assert.throws(() => {
65
- test_error.throwArbitrary(value);
66
- }, value);
+ assert.throws(
+ () => test_error.throwArbitrary(value),
+ (err) => {
67
+ assert.strictEqual(err, value);
68
+ return true;
69
+ });
70
}
71
72
testThrowArbitrary(42);
73
testThrowArbitrary({});
74
testThrowArbitrary([]);
75
testThrowArbitrary(Symbol('xyzzy'));
76
testThrowArbitrary(true);
77
+testThrowArbitrary('ball');
78
+testThrowArbitrary(undefined);
79
+testThrowArbitrary(null);
80
+testThrowArbitrary(NaN);
81
82
common.expectsError(
83
() => test_error.throwErrorCode(),
0 commit comments