Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: replace assertion error functions w regex err msg
  • Loading branch information
TheLady committed Apr 22, 2017
commit 66d8ac0c76be08d8b72ca5fcb2f225074d09d30b
6 changes: 4 additions & 2 deletions test/parallel/test-v8-flag-type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ require('../common');
const assert = require('assert');
const v8 = require('v8');

assert.throws(function() { v8.setFlagsFromString(1); }, TypeError);
assert.throws(function() { v8.setFlagsFromString(); }, TypeError);
assert.throws(function() { v8.setFlagsFromString(1); },
/^TypeError: v8 flag must be a string$/);
assert.throws(function() { v8.setFlagsFromString(); },
/^TypeError: v8 flag is required$/);
6 changes: 4 additions & 2 deletions test/parallel/test-v8-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ assert(eval('%_IsSmi(42)'));
assert(vm.runInThisContext('%_IsSmi(43)'));

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