-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: changed test1 of test-vm-timeout.js so that entire error message would be matched #11590
Conversation
…e would be matached in assert.throw
…e would be matched Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out."
test/parallel/test-vm-timeout.js
Outdated
@@ -6,6 +6,9 @@ const vm = require('vm'); | |||
// Test 1: Timeout of 100ms executing endless loop | |||
assert.throws(function() { | |||
vm.runInThisContext('while(true) {}', { timeout: 100 }); | |||
}, function(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using a regexp as the second argument would be more succinct: /^Error: Script execution timed out\.$/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha I agree with you before when I tried /^Script execution timed out.$/ it didn't work, so I did the above approached. I didn't realize that "Error: " was included also. Awesome I will correct it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
Landed in 94d1c8d, thanks for the PR! |
test: changed test1 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out." PR-URL: #11590 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
test: changed test1 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out." PR-URL: #11590 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
test: changed test1 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out." PR-URL: #11590 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
test: changed test1 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out." PR-URL: #11590 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
test: changed test1 of test-vm-timeout.js so that entire error message would be matched in assert.throw. Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out." PR-URL: nodejs/node#11590 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out."
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)