Skip to content
Browse files

test: improve assert messages in napi exception test

Include unexpected value in assertion messages.

PR-URL: #16820
Reviewed-By: Gireesh Punathil <>
Reviewed-By: Rich Trott <>
  • Loading branch information
PaulBlanche authored and Trott committed Nov 8, 2017
1 parent 7d99762 commit e04d23c1fd1b9c3dc0d436514b496a6493909616
Showing with 4 additions and 2 deletions.
  1. +4 −2 test/addons-napi/test_exception/test.js
@@ -33,7 +33,8 @@ assert.strictEqual(test_exception.wasPending(), true,
// Test that the native side does not capture a non-existing exception
returnedError = test_exception.returnException(common.mustCall());
assert.strictEqual(undefined, returnedError,
'Returned error is undefined when no exception is thrown');
'Returned error should be undefined when no exception is' +
` thrown, but ${returnedError} was passed`);

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

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

0 comments on commit e04d23c

Please sign in to comment.
You can’t perform that action at this time.