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 <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent 4166128 commit 5fe6840

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ console.error('thrown error');
1717
script=newScript('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=newScript('foo.bar = 5;');
2525
assert.throws(function(){
2626
script.runInNewContext();
27-
},/notdefined/);
27+
},/^ReferenceError:fooisnotdefined$/);
2828

2929

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

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

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

0 commit comments

Comments
 (0)