From 66d8ac0c76be08d8b72ca5fcb2f225074d09d30b Mon Sep 17 00:00:00 2001 From: thelady Date: Sat, 22 Apr 2017 13:43:43 -0700 Subject: [PATCH] test: replace assertion error functions w regex err msg --- test/parallel/test-v8-flag-type-check.js | 6 ++++-- test/parallel/test-v8-flags.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-v8-flag-type-check.js b/test/parallel/test-v8-flag-type-check.js index b5d4d7c2f12665..144e8f7a2e3d07 100644 --- a/test/parallel/test-v8-flag-type-check.js +++ b/test/parallel/test-v8-flag-type-check.js @@ -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$/); diff --git a/test/parallel/test-v8-flags.js b/test/parallel/test-v8-flags.js index 99384080516bb2..50d7047a5ddfa9 100644 --- a/test/parallel/test-v8-flags.js +++ b/test/parallel/test-v8-flags.js @@ -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 %$/);