diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js index 693a0411386..56df3738c11 100644 --- a/test/parallel/test-vm-new-script-new-context.js +++ b/test/parallel/test-vm-new-script-new-context.js @@ -17,14 +17,14 @@ console.error('thrown error'); script = new Script('throw new Error(\'test\');'); assert.throws(function() { script.runInNewContext(); -}, /test/); +}, /^Error: test$/); console.error('undefined reference'); script = new Script('foo.bar = 5;'); assert.throws(function() { script.runInNewContext(); -}, /not defined/); +}, /^ReferenceError: foo is not defined$/); global.hello = 5; @@ -61,9 +61,9 @@ assert.strictEqual(f.a, 2); assert.throws(function() { script.runInNewContext(); -}, /f is not defined/); +}, /^ReferenceError: f is not defined$/); console.error('invalid this'); assert.throws(function() { script.runInNewContext.call('\'hello\';'); -}, TypeError); +}, /^TypeError: this\.runInContext is not a function$/);