Skip to content

Commit 5fe6840

Browse files
AkshayIyer12MylesBorins
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 4166128 commit 5fe6840

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
@@ -17,14 +17,14 @@ console.error('thrown error');
1717
script = new Script('throw new Error(\'test\');');
1818
assert.throws(function() {
1919
script.runInNewContext();
20-
}, /test/);
20+
}, /^Error: test$/);
2121

2222

2323
console.error('undefined reference');
2424
script = new Script('foo.bar = 5;');
2525
assert.throws(function() {
2626
script.runInNewContext();
27-
}, /not defined/);
27+
}, /^ReferenceError: foo is not defined$/);
2828

2929

3030
global.hello = 5;
@@ -61,9 +61,9 @@ assert.strictEqual(f.a, 2);
6161

6262
assert.throws(function() {
6363
script.runInNewContext();
64-
}, /f is not defined/);
64+
}, /^ReferenceError: f is not defined$/);
6565

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

0 commit comments

Comments
 (0)