Skip to content

Commit

Permalink
test: fix assert order in test-vm-context
Browse files Browse the repository at this point in the history
PR-URL: #23523
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
lee-gray authored and jasnell committed Oct 17, 2018
1 parent ba5cf7b commit e9efac6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-vm-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit e9efac6

Please sign in to comment.