From 0fab842e13a0432b707abdb2ff544992c2fe5c4d Mon Sep 17 00:00:00 2001 From: Lee Gray Date: Fri, 12 Oct 2018 10:23:09 -0700 Subject: [PATCH] test: fix assert order in test-vm-context PR-URL: https://github.com/nodejs/node/pull/23523 Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- test/parallel/test-vm-context.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index 31ed69da93fabc..e1cfd145f226ad 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -30,18 +30,18 @@ let script = new Script('"passed";'); // Run in a new empty context let context = vm.createContext(); let result = script.runInContext(context); -assert.strictEqual('passed', result); +assert.strictEqual(result, 'passed'); // Create a new pre-populated context context = vm.createContext({ 'foo': 'bar', 'thing': 'lala' }); -assert.strictEqual('bar', context.foo); -assert.strictEqual('lala', context.thing); +assert.strictEqual(context.foo, 'bar'); +assert.strictEqual(context.thing, 'lala'); // Test updating context script = new Script('foo = 3;'); result = script.runInContext(context); -assert.strictEqual(3, context.foo); -assert.strictEqual('lala', context.thing); +assert.strictEqual(context.foo, 3); +assert.strictEqual(context.thing, 'lala'); // Issue GH-227: common.expectsError(() => {