From 779402ec5fad18d090eed1554c3f79f56f5957ae Mon Sep 17 00:00:00 2001 From: aniketshukla Date: Sun, 4 Jun 2017 00:41:42 +0530 Subject: [PATCH] test: validate full error messages test: changed test2 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 2 of test-vm-timeout.js would match any RangeError, now it looks specifically for the error message "RangeError: timeout must be a positive number" test: changed test 3 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 3 of test-vm-timeout.js would match any RangeError, now it looks specifically for the error message "RangeError: timeout must be a positive number" PR-URL: https://github.com/nodejs/node/pull/13453 Refs: https://github.com/nodejs/node/issues/13454 Reviewed-By: Refael Ackermann Reviewed-By: Vse Mozhet Byt Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto --- test/parallel/test-vm-timeout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 });