From 8ddf54648a1f1174b11323135e5571ea97f2715f Mon Sep 17 00:00:00 2001 From: Steve Jenkins Date: Fri, 6 Oct 2017 10:01:02 -0700 Subject: [PATCH] assert: fix actual and expected order PR-URL: https://github.com/nodejs/node/pull/15866 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Gireesh Punathil --- test/parallel/test-vm-run-in-new-context.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js index 95184f1e629f12..73c1eccd937295 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -12,7 +12,7 @@ common.globalCheck = false; // Run a string const result = vm.runInNewContext('\'passed\';'); -assert.strictEqual('passed', result); +assert.strictEqual(result, 'passed'); // Thrown error assert.throws(() => { @@ -21,7 +21,7 @@ assert.throws(() => { global.hello = 5; vm.runInNewContext('hello = 2'); -assert.strictEqual(5, global.hello); +assert.strictEqual(global.hello, 5); // Pass values in and out @@ -33,9 +33,9 @@ global.obj = { foo: 0, baz: 3 }; /* eslint-disable no-unused-vars */ const baz = vm.runInNewContext(global.code, global.obj); /* eslint-enable no-unused-vars */ -assert.strictEqual(1, global.obj.foo); -assert.strictEqual(2, global.obj.bar); -assert.strictEqual(2, global.foo); +assert.strictEqual(global.obj.foo, 1); +assert.strictEqual(global.obj.bar, 2); +assert.strictEqual(global.foo, 2); // Call a function by reference function changeFoo() { global.foo = 100; }