Skip to content

Commit c62f2e2

Browse files
skystevetargos
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 181ee5d commit c62f2e2

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ common.globalCheck = false;
3333

3434
// Run a string
3535
const result = vm.runInNewContext('\'passed\';');
36-
assert.strictEqual('passed', result);
36+
assert.strictEqual(result, 'passed');
3737

3838
// Thrown error
3939
assert.throws(() => {
@@ -42,7 +42,7 @@ assert.throws(() => {
4242

4343
global.hello = 5;
4444
vm.runInNewContext('hello = 2');
45-
assert.strictEqual(5, global.hello);
45+
assert.strictEqual(global.hello, 5);
4646

4747

4848
// Pass values in and out
@@ -54,9 +54,9 @@ global.obj = { foo: 0, baz: 3 };
5454
/* eslint-disable no-unused-vars */
5555
const baz = vm.runInNewContext(global.code, global.obj);
5656
/* eslint-enable no-unused-vars */
57-
assert.strictEqual(1, global.obj.foo);
58-
assert.strictEqual(2, global.obj.bar);
59-
assert.strictEqual(2, global.foo);
57+
assert.strictEqual(global.obj.foo, 1);
58+
assert.strictEqual(global.obj.bar, 2);
59+
assert.strictEqual(global.foo, 2);
6060

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

0 commit comments

Comments
 (0)