Skip to content

Commit 757ae52

Browse files
aniketshuklajasnell
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 <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
1 parent 658560e commit 757ae52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-vm-timeout.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ assert.throws(function() {
3232
// Test 2: Timeout must be >= 0ms
3333
assert.throws(function() {
3434
vm.runInThisContext('', { timeout: -1 });
35-
}, RangeError);
35+
}, /^RangeError: timeout must be a positive number$/);
3636

3737
// Test 3: Timeout of 0ms
3838
assert.throws(function() {
3939
vm.runInThisContext('', { timeout: 0 });
40-
}, RangeError);
40+
}, /^RangeError: timeout must be a positive number$/);
4141

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

0 commit comments

Comments
 (0)