Skip to content

Commit 1f6c86d

Browse files
KelvinLawHF1jasnell
authored andcommitted
test: fix assertions argument order
PR-URL: #23544 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 0655229 commit 1f6c86d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-vm-static-this.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const vm = require('vm');
2626

2727
// Run a string
2828
const result = vm.runInThisContext('\'passed\';');
29-
assert.strictEqual('passed', result);
29+
assert.strictEqual(result, 'passed');
3030

3131
// thrown error
3232
assert.throws(function() {
@@ -35,7 +35,7 @@ assert.throws(function() {
3535

3636
global.hello = 5;
3737
vm.runInThisContext('hello = 2');
38-
assert.strictEqual(2, global.hello);
38+
assert.strictEqual(global.hello, 2);
3939

4040

4141
// pass values
@@ -48,14 +48,14 @@ global.obj = { foo: 0, baz: 3 };
4848
/* eslint-disable no-unused-vars */
4949
const baz = vm.runInThisContext(code);
5050
/* eslint-enable no-unused-vars */
51-
assert.strictEqual(0, global.obj.foo);
52-
assert.strictEqual(2, global.bar);
53-
assert.strictEqual(1, global.foo);
51+
assert.strictEqual(global.obj.foo, 0);
52+
assert.strictEqual(global.bar, 2);
53+
assert.strictEqual(global.foo, 1);
5454

5555
// call a function
5656
global.f = function() { global.foo = 100; };
5757
vm.runInThisContext('f()');
58-
assert.strictEqual(100, global.foo);
58+
assert.strictEqual(global.foo, 100);
5959

6060
common.allowGlobals(
6161
global.hello,

0 commit comments

Comments
 (0)