Skip to content

Commit

Permalink
test: refactor test-vm-new-script-new-context
Browse files Browse the repository at this point in the history
Changed the second parameter of assert.throws to match the errors.

PR-URL: nodejs#13035
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
AkshayIyer12 authored and Trott committed May 19, 2017
1 parent 29d89c9 commit a593c74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-vm-new-script-new-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ console.error('thrown error');
script = new Script('throw new Error(\'test\');');
assert.throws(function() {
script.runInNewContext();
}, /test/);
}, /^Error: test$/);


console.error('undefined reference');
script = new Script('foo.bar = 5;');
assert.throws(function() {
script.runInNewContext();
}, /not defined/);
}, /^ReferenceError: foo is not defined$/);


global.hello = 5;
Expand Down Expand Up @@ -82,9 +82,9 @@ assert.strictEqual(f.a, 2);

assert.throws(function() {
script.runInNewContext();
}, /f is not defined/);
}, /^ReferenceError: f is not defined$/);

console.error('invalid this');
assert.throws(function() {
script.runInNewContext.call('\'hello\';');
}, TypeError);
}, /^TypeError: this\.runInContext is not a function$/);

0 comments on commit a593c74

Please sign in to comment.