From 5fe68402bdad0c1b00a284c1f8d658152eef0336 Mon Sep 17 00:00:00 2001 From: Akshay Iyer Date: Mon, 15 May 2017 10:35:00 +0530 Subject: [PATCH] test: refactor test-vm-new-script-new-context Changed the second parameter of assert.throws to match the errors. PR-URL: https://github.com/nodejs/node/pull/13035 Reviewed-By: Rich Trott Reviewed-By: Refael Ackermann --- test/parallel/test-vm-new-script-new-context.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js index 693a041138..56df3738c1 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$/);