Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55bf57d

Browse filesBrowse files
PaulBlanchegibfahn
authored andcommitted
test: improve assert messages in napi exception test
Include unexpected value in assertion messages. PR-URL: #16820 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent b8561c2 commit 55bf57d
Copy full SHA for 55bf57d

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
  • test/addons-napi/test_exception
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎test/addons-napi/test_exception/test.js‎

Copy file name to clipboardExpand all lines: test/addons-napi/test_exception/test.js
+4-2Lines changed: 4 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.