Skip to content

Commit 80ceb04

Browse files
TheLadyevanlucas
authored andcommitted
test: replace assertion error check with regex
PR-URL: #12603 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 2021ea1 commit 80ceb04

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/parallel/test-v8-flag-type-check.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ require('../common');
33
const assert = require('assert');
44
const v8 = require('v8');
55

6-
assert.throws(function() { v8.setFlagsFromString(1); }, TypeError);
7-
assert.throws(function() { v8.setFlagsFromString(); }, TypeError);
6+
assert.throws(function() { v8.setFlagsFromString(1); },
7+
/^TypeError: v8 flag must be a string$/);
8+
assert.throws(function() { v8.setFlagsFromString(); },
9+
/^TypeError: v8 flag is required$/);

test/parallel/test-v8-flags.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ assert(eval('%_IsSmi(42)'));
1212
assert(vm.runInThisContext('%_IsSmi(43)'));
1313

1414
v8.setFlagsFromString('--noallow_natives_syntax');
15-
assert.throws(function() { eval('%_IsSmi(44)'); }, SyntaxError);
16-
assert.throws(function() { vm.runInThisContext('%_IsSmi(45)'); }, SyntaxError);
15+
assert.throws(function() { eval('%_IsSmi(44)'); },
16+
/^SyntaxError: Unexpected token %$/);
17+
assert.throws(function() { vm.runInThisContext('%_IsSmi(45)'); },
18+
/^SyntaxError: Unexpected token %$/);

0 commit comments

Comments
 (0)