Skip to content

Commit a593c74

Browse files
AkshayIyer12Trott
authored andcommitted
test: refactor test-vm-new-script-new-context
Changed the second parameter of assert.throws to match the errors. PR-URL: #13035 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 29d89c9 commit a593c74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-vm-new-script-new-context.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ console.error('thrown error');
3838
script = new Script('throw new Error(\'test\');');
3939
assert.throws(function() {
4040
script.runInNewContext();
41-
}, /test/);
41+
}, /^Error: test$/);
4242

4343

4444
console.error('undefined reference');
4545
script = new Script('foo.bar = 5;');
4646
assert.throws(function() {
4747
script.runInNewContext();
48-
}, /not defined/);
48+
}, /^ReferenceError: foo is not defined$/);
4949

5050

5151
global.hello = 5;
@@ -82,9 +82,9 @@ assert.strictEqual(f.a, 2);
8282

8383
assert.throws(function() {
8484
script.runInNewContext();
85-
}, /f is not defined/);
85+
}, /^ReferenceError: f is not defined$/);
8686

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

0 commit comments

Comments
 (0)