test-vm-is-context.js : changed the assert.thows object to regex and …#12785
test-vm-is-context.js : changed the assert.thows object to regex and …#12785Jeyanthinath wants to merge 5 commits intonodejs:masterfrom
Conversation
…added score for sanbox object
test/parallel/test-vm-is-context.js
Outdated
| assert.throws(function() { | ||
| vm.isContext('string is not supported'); | ||
| }, TypeError); | ||
| }, /TypeError/); |
There was a problem hiding this comment.
Can you please change this to: /^TypeError: sandbox must be an object$/?
There was a problem hiding this comment.
I did changed ! thanks
test/parallel/test-vm-is-context.js
Outdated
| const sandbox = { foo: 'bar' }; | ||
| vm.createContext(sandbox); | ||
| assert.strictEqual(vm.isContext(sandbox), true); | ||
| { |
There was a problem hiding this comment.
I see no reasons to add this block.
There was a problem hiding this comment.
I thought it would restrict the access of sandbox variable. @lpinca any suggestion ?
There was a problem hiding this comment.
It might be useful if you want to reuse the sandbox variable in another scope but currently there is no need for it.
There was a problem hiding this comment.
I don't think it really matters either way, but I personally would probably opt to just wait until someone adds another test below it that also uses variables.
There was a problem hiding this comment.
ok , I will revoke it as of now
|
The commit messages should adhere to the commit guidelines. |
assert.throws initally throws the TypeError constructor and now replacing that with regular expression
test/parallel/test-vm-is-context.js
Outdated
| const sandbox = { foo: 'bar' }; | ||
| vm.createContext(sandbox); | ||
| assert.strictEqual(vm.isContext(sandbox), true); | ||
| const sandbox = { foo: 'bar' }; |
There was a problem hiding this comment.
@Jeyanthinath please revert also these white space changes.
There was a problem hiding this comment.
oops , I missed those , thanks !
assert.throws initally throws the TypeError constructor and now replacing that with regular expression
|
How about using something like this for commit message? |
Use a regex to validate the error message.
addaleax
left a comment
There was a problem hiding this comment.
LGTM, thank you for fixing this!
Use a regex to validate the error message. PR-URL: nodejs#12785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in bc05436. |
Use a regex to validate the error message. PR-URL: nodejs#12785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Use a regex to validate the error message. PR-URL: #12785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Use a regex to validate the error message. PR-URL: #12785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Use a regex to validate the error message. PR-URL: #12785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
…added score for sanbox object
First Pull request ...
In assert.throws changed the TypeError constructor to Regex .
Aslo added Scope for Sandbox Object