Skip to content

Commit 779402e

Browse files
aniketshuklaMylesBorins
authored andcommitted
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: #13453 Refs: #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>
1 parent 1026718 commit 779402e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-vm-timeout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ assert.throws(function() {
1111
// Test 2: Timeout must be >= 0ms
1212
assert.throws(function() {
1313
vm.runInThisContext('', { timeout: -1 });
14-
}, RangeError);
14+
}, /^RangeError: timeout must be a positive number$/);
1515

1616
// Test 3: Timeout of 0ms
1717
assert.throws(function() {
1818
vm.runInThisContext('', { timeout: 0 });
19-
}, RangeError);
19+
}, /^RangeError: timeout must be a positive number$/);
2020

2121
// Test 4: Timeout of 1000ms, script finishes first
2222
vm.runInThisContext('', { timeout: 1000 });

0 commit comments

Comments
 (0)