Skip to content

Commit

Permalink
test: fix assertions argument order
Browse files Browse the repository at this point in the history
PR-URL: #23544
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
KelvinLawHF1 authored and jasnell committed Oct 17, 2018
1 parent 0655229 commit 1f6c86d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-vm-static-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 1f6c86d

Please sign in to comment.