Skip to content

Commit 371ca03

Browse files
dbradfaddaleax
authored andcommitted
test: refactor test-vm-static-this.js
Remove console statements and prefer strictEqual() over equal() in assertions. PR-URL: #9887 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 3e37673 commit 371ca03

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/parallel/test-vm-static-this.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ var vm = require('vm');
55

66
common.globalCheck = false;
77

8-
console.error('run a string');
8+
// Run a string
99
var result = vm.runInThisContext('\'passed\';');
10-
assert.equal('passed', result);
10+
assert.strictEqual('passed', result);
1111

12-
console.error('thrown error');
12+
// thrown error
1313
assert.throws(function() {
1414
vm.runInThisContext('throw new Error(\'test\');');
1515
}, /test/);
1616

1717
global.hello = 5;
1818
vm.runInThisContext('hello = 2');
19-
assert.equal(2, global.hello);
19+
assert.strictEqual(2, global.hello);
2020

2121

22-
console.error('pass values');
22+
// pass values
2323
var code = 'foo = 1;' +
2424
'bar = 2;' +
2525
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
@@ -28,11 +28,11 @@ global.obj = { foo: 0, baz: 3 };
2828
/* eslint-disable no-unused-vars */
2929
var baz = vm.runInThisContext(code);
3030
/* eslint-enable no-unused-vars */
31-
assert.equal(0, global.obj.foo);
32-
assert.equal(2, global.bar);
33-
assert.equal(1, global.foo);
31+
assert.strictEqual(0, global.obj.foo);
32+
assert.strictEqual(2, global.bar);
33+
assert.strictEqual(1, global.foo);
3434

35-
console.error('call a function');
35+
// call a function
3636
global.f = function() { global.foo = 100; };
3737
vm.runInThisContext('f()');
38-
assert.equal(100, global.foo);
38+
assert.strictEqual(100, global.foo);

0 commit comments

Comments
 (0)