Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: changed test1 of test-vm-timeout.js so that entire error messag…
…e would be matached in assert.throw
  • Loading branch information
moe-dizzle committed Feb 27, 2017
commit 50fe4f0fad58ec3ddc0167a04e596261a3e9d496
10 changes: 9 additions & 1 deletion test/parallel/test-vm-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ const vm = require('vm');
// Test 1: Timeout of 100ms executing endless loop
assert.throws(function() {
vm.runInThisContext('while(true) {}', { timeout: 100 });
});
},
function(err) {
if ( (err instanceof Error) && /^Script execution timed out\.$/.test(err.message) ) {
return true;
}
}


);

// Test 2: Timeout must be >= 0ms
assert.throws(function() {
Expand Down