Browse Source

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 <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
v6
aniketshukla 8 years ago
committed by Refael Ackermann
parent
commit
12e39d6d94
  1. 4
      test/parallel/test-vm-timeout.js

4
test/parallel/test-vm-timeout.js

@ -32,12 +32,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 });

Loading…
Cancel
Save