Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fix assert.strictEqual argument order
PR-URL: #23457
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
andy-ganchrow authored and Trott committed Oct 13, 2018
commit a2392704b2987073a2c918f349e91e7c5ecaed7c
12 changes: 6 additions & 6 deletions test/parallel/test-vm-new-script-new-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const Script = require('vm').Script;
const script = new Script('\'passed\';');
const result1 = script.runInNewContext();
const result2 = script.runInNewContext();
assert.strictEqual('passed', result1);
assert.strictEqual('passed', result2);
assert.strictEqual(result1, 'passed');
assert.strictEqual(result2, 'passed');
}

{
Expand All @@ -52,7 +52,7 @@ const Script = require('vm').Script;
global.hello = 5;
const script = new Script('hello = 2');
script.runInNewContext();
assert.strictEqual(5, global.hello);
assert.strictEqual(global.hello, 5);

// Cleanup
delete global.hello;
Expand All @@ -68,9 +68,9 @@ const Script = require('vm').Script;
/* eslint-disable no-unused-vars */
const baz = script.runInNewContext(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);

// cleanup
delete global.code;
Expand Down