Skip to content

Commit 4d55a1d

Browse files
PaulBlancheevanlucas
authored andcommitted
test: improve assert messages in napi exception test
Include unexpected value in assertion messages. PR-URL: #16820 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 928647c commit 4d55a1d

File tree

1 file changed

+4
-2
lines changed
  • test/addons-napi/test_exception

1 file changed

+4
-2
lines changed

test/addons-napi/test_exception/test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ assert.strictEqual(test_exception.wasPending(), true,
3333
// Test that the native side does not capture a non-existing exception
3434
returnedError = test_exception.returnException(common.mustCall());
3535
assert.strictEqual(undefined, returnedError,
36-
'Returned error is undefined when no exception is thrown');
36+
'Returned error should be undefined when no exception is' +
37+
` thrown, but ${returnedError} was passed`);
3738

3839
// Test that no exception appears that was not thrown by us
3940
try {
@@ -42,7 +43,8 @@ try {
4243
caughtError = anError;
4344
}
4445
assert.strictEqual(undefined, caughtError,
45-
'No exception originated on the native side');
46+
'No exception originated on the native side, but' +
47+
` ${caughtError} was passed`);
4648

4749
// Test that the exception state remains clear when no exception is thrown
4850
assert.strictEqual(test_exception.wasPending(), false,

0 commit comments

Comments
 (0)