From c9cf9222489b94a84852e24e43c1065ba63b32f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Kraj=C4=8Dovi=C4=8D?= Date: Sun, 12 Mar 2017 16:09:32 +0100 Subject: [PATCH] test: add regex to assert.throws Make sure test matches this specific error message. PR-URL: https://github.com/nodejs/node/pull/11815 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: James M Snell --- test/parallel/test-vm-run-in-new-context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js index 7b096ffc3fdc5f..3f8c632859db0f 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -17,7 +17,7 @@ assert.strictEqual('passed', result); console.error('thrown error'); assert.throws(function() { vm.runInNewContext('throw new Error(\'test\');'); -}); +}, /^Error: test$/); global.hello = 5; vm.runInNewContext('hello = 2');