Skip to content

Commit 575a920

Browse files
skysteveMylesBorins
authored andcommitted
assert: fix actual and expected order
PR-URL: #15866 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent cf80089 commit 575a920

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-vm-run-in-new-context.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ common.globalCheck = false;
1212

1313
// Run a string
1414
const result = vm.runInNewContext('\'passed\';');
15-
assert.strictEqual('passed', result);
15+
assert.strictEqual(result, 'passed');
1616

1717
// Thrown error
1818
assert.throws(() => {
@@ -21,7 +21,7 @@ assert.throws(() => {
2121

2222
global.hello = 5;
2323
vm.runInNewContext('hello = 2');
24-
assert.strictEqual(5, global.hello);
24+
assert.strictEqual(global.hello, 5);
2525

2626

2727
// Pass values in and out
@@ -33,9 +33,9 @@ global.obj = { foo: 0, baz: 3 };
3333
/* eslint-disable no-unused-vars */
3434
const baz = vm.runInNewContext(global.code, global.obj);
3535
/* eslint-enable no-unused-vars */
36-
assert.strictEqual(1, global.obj.foo);
37-
assert.strictEqual(2, global.obj.bar);
38-
assert.strictEqual(2, global.foo);
36+
assert.strictEqual(global.obj.foo, 1);
37+
assert.strictEqual(global.obj.bar, 2);
38+
assert.strictEqual(global.foo, 2);
3939

4040
// Call a function by reference
4141
function changeFoo() { global.foo = 100; }

0 commit comments

Comments
 (0)