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 8c9b41a

Browse filesBrowse files
blairwilcoxMylesBorins
authored andcommitted
test: show pending exception error in napi tests
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: #18413 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 650ec2d commit 8c9b41a
Copy full SHA for 8c9b41a

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+8
-6
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
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ const theError = new Error('Some error');
2020

2121
// Test that the exception thrown above was marked as pending
2222
// before it was handled on the JS side
23-
assert.strictEqual(test_exception.wasPending(), true,
24-
'VM was marked as having an exception pending' +
25-
' when it was allowed through');
23+
const exception_pending = test_exception.wasPending();
24+
assert.strictEqual(exception_pending, true,
25+
'Exception not pending as expected,' +
26+
` .wasPending() returned ${exception_pending}`);
2627

2728
// Test that the native side does not capture a non-existing exception
2829
returnedError = test_exception.returnException(common.mustCall());
@@ -44,7 +45,8 @@ const theError = new Error('Some error');
4445
` ${caughtError} was passed`);
4546

4647
// Test that the exception state remains clear when no exception is thrown
47-
assert.strictEqual(test_exception.wasPending(), false,
48-
'VM was not marked as having an exception pending' +
49-
' when none was allowed through');
48+
const exception_pending = test_exception.wasPending();
49+
assert.strictEqual(exception_pending, false,
50+
'Exception state did not remain clear as expected,' +
51+
` .wasPending() returned ${exception_pending}`);
5052
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.