test: use regluar expression in vm test

update test/parallel/test-vm-create-context-arg.js
in line 27 to change `TypeError` to the regular expression
with the `/^TypeError: sandbox must be an object$/`.

PR-URL: https://github.com/nodejs/node/pull/14266
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
akira.xue 2017-07-16 15:10:37 +08:00 committed by Rich Trott
parent bfae1feb38
commit e8170f2246

View File

@ -26,7 +26,7 @@ const vm = require('vm');
assert.throws(function() {
vm.createContext('string is not supported');
}, TypeError);
}, /^TypeError: sandbox must be an object$/);
assert.doesNotThrow(function() {
vm.createContext({ a: 1 });