diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index 6ed73f8b4ffd78..73f68176473c8c 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -11,12 +11,12 @@ assert.throws(function() { // Test 2: Timeout must be >= 0ms assert.throws(function() { vm.runInThisContext('', { timeout: -1 }); -}, RangeError); +}, /^RangeError: timeout must be a positive number$/); // Test 3: Timeout of 0ms assert.throws(function() { vm.runInThisContext('', { timeout: 0 }); -}, RangeError); +}, /^RangeError: timeout must be a positive number$/); // Test 4: Timeout of 1000ms, script finishes first vm.runInThisContext('', { timeout: 1000 });