-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
test: refactored context type err message to regex #12596
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,9 +62,27 @@ assert.ok(gh1140Exception, | |
'expected exception from runInContext signature test'); | ||
|
||
// GH-558, non-context argument segfaults / raises assertion | ||
[undefined, null, 0, 0.0, '', {}, []].forEach(function(e) { | ||
assert.throws(function() { script.runInContext(e); }, TypeError); | ||
assert.throws(function() { vm.runInContext('', e); }, TypeError); | ||
const nonContextualSandboxErrorMsg = | ||
/^TypeError: contextifiedSandbox argument must be an object\.$/; | ||
|
||
[undefined, null, 0, 0.0, ''].forEach(function(e) { | ||
|
||
|
||
assert.throws(function() { script.runInContext(e); }, | ||
nonContextualSandboxErrorMsg); | ||
assert.throws(function() { vm.runInContext('', e); }, | ||
nonContextualSandboxErrorMsg); | ||
}); | ||
|
||
// GH-558, non-context argument segfaults / raises assertion | ||
const contextifiedSandboxErrorMsg = | ||
/^TypeError: sandbox argument must have been converted to a context\.$/; | ||
|
||
[{}, []].forEach(function(e) { | ||
|
||
|
||
assert.throws(function() { script.runInContext(e); }, | ||
contextifiedSandboxErrorMsg); | ||
assert.throws(function() { vm.runInContext('', e); }, | ||
contextifiedSandboxErrorMsg); | ||
}); | ||
|
||
// Issue GH-693: | ||
|
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.
Can you remove this blank line.