Skip to content

Commit 0bd0d52

Browse files
TheLadyMylesBorins
authored andcommittedMay 18, 2017
test: replace assertion error check with regex
PR-URL: #12603 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 8044b83 commit 0bd0d52

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)
Please sign in to comment.