Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

Commit

Permalink
assert: fix actual and expected order
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#15866
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
skysteve authored and addaleax committed Oct 15, 2017
1 parent 9cb8a01 commit 0f0703b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-vm-run-in-new-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ common.globalCheck = false;

// Run a string
const result = vm.runInNewContext('\'passed\';');
assert.strictEqual('passed', result);
assert.strictEqual(result, 'passed');

// Thrown error
assert.throws(() => {
Expand All @@ -42,7 +42,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
Expand All @@ -54,9 +54,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; }
Expand Down

0 comments on commit 0f0703b

Please sign in to comment.