From 1f6c86d1ea1843a07d5954ac96337a2d107b533b Mon Sep 17 00:00:00 2001 From: KelvinLawHF1 Date: Fri, 12 Oct 2018 10:26:11 -0700 Subject: [PATCH] test: fix assertions argument order PR-URL: https://github.com/nodejs/node/pull/23544 Reviewed-By: Anatoli Papirovski Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater --- test/parallel/test-vm-static-this.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index d4530604dc06f0..e9382d6c3b4c1a 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -26,7 +26,7 @@ const vm = require('vm'); // Run a string const result = vm.runInThisContext('\'passed\';'); -assert.strictEqual('passed', result); +assert.strictEqual(result, 'passed'); // thrown error assert.throws(function() { @@ -35,7 +35,7 @@ assert.throws(function() { global.hello = 5; vm.runInThisContext('hello = 2'); -assert.strictEqual(2, global.hello); +assert.strictEqual(global.hello, 2); // pass values @@ -48,14 +48,14 @@ global.obj = { foo: 0, baz: 3 }; /* eslint-disable no-unused-vars */ const baz = vm.runInThisContext(code); /* eslint-enable no-unused-vars */ -assert.strictEqual(0, global.obj.foo); -assert.strictEqual(2, global.bar); -assert.strictEqual(1, global.foo); +assert.strictEqual(global.obj.foo, 0); +assert.strictEqual(global.bar, 2); +assert.strictEqual(global.foo, 1); // call a function global.f = function() { global.foo = 100; }; vm.runInThisContext('f()'); -assert.strictEqual(100, global.foo); +assert.strictEqual(global.foo, 100); common.allowGlobals( global.hello,