From bc05436a891da91211c9bbcff08d43133558a1d6 Mon Sep 17 00:00:00 2001 From: jeyanthinath Date: Tue, 2 May 2017 14:55:10 +0530 Subject: [PATCH] test: add regex check in test-vm-is-context Use a regex to validate the error message. PR-URL: https://github.com/nodejs/node/pull/12785 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-vm-is-context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-vm-is-context.js b/test/parallel/test-vm-is-context.js index 1c5a2244323cc3..6c3b783c5e9c33 100644 --- a/test/parallel/test-vm-is-context.js +++ b/test/parallel/test-vm-is-context.js @@ -26,7 +26,7 @@ const vm = require('vm'); assert.throws(function() { vm.isContext('string is not supported'); -}, TypeError); +}, /^TypeError: sandbox must be an object$/); assert.strictEqual(vm.isContext({}), false); assert.strictEqual(vm.isContext([]), false);