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 c42eb5d

Browse filesBrowse files
himself65targos
authored andcommitted
test: refactoring test_error testing
PR-URL: #28902 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent c93df0c commit c42eb5d
Copy full SHA for c42eb5d

File tree

Expand file treeCollapse file tree

1 file changed

+4
-14
lines changed
Open diff view settings
Filter options
  • test/js-native-api/test_error
Expand file treeCollapse file tree

1 file changed

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

‎test/js-native-api/test_error/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_error/test.js
+4-14Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,14 @@ assert.throws(() => {
6060
test_error.throwTypeError();
6161
}, /^TypeError: type error$/);
6262

63-
function testThrowArbitrary(value) {
64-
assert.throws(
63+
[42, {}, [], Symbol('xyzzy'), true, 'ball', undefined, null, NaN]
64+
.forEach((value) => assert.throws(
6565
() => test_error.throwArbitrary(value),
6666
(err) => {
6767
assert.strictEqual(err, value);
6868
return true;
69-
});
70-
}
71-
72-
testThrowArbitrary(42);
73-
testThrowArbitrary({});
74-
testThrowArbitrary([]);
75-
testThrowArbitrary(Symbol('xyzzy'));
76-
testThrowArbitrary(true);
77-
testThrowArbitrary('ball');
78-
testThrowArbitrary(undefined);
79-
testThrowArbitrary(null);
80-
testThrowArbitrary(NaN);
69+
}
70+
));
8171

8272
common.expectsError(
8373
() => test_error.throwErrorCode(),

0 commit comments

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