summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Blanche <blanchepaule@whiteshoulders.fr>2017-11-06 16:27:05 +0100
committerMyles Borins <mylesborins@google.com>2018-04-16 17:46:10 -0400
commitd4c04e05f7b1ef90365735f63a08d38a7d889550 (patch)
treef947176c3b9ce0b69c7d9623299f5d683208c192
parentc14207c77b944f8e28e88ed75bca7c880cfe25fc (diff)
downloadnode-new-d4c04e05f7b1ef90365735f63a08d38a7d889550.tar.gz
test: improve assert messages in napi exception test
Include unexpected value in assertion messages. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16820 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r--test/addons-napi/test_exception/test.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/addons-napi/test_exception/test.js b/test/addons-napi/test_exception/test.js
index b8626b4ddd..8bd2f50b12 100644
--- a/test/addons-napi/test_exception/test.js
+++ b/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,