Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 371ca03

Browse filesBrowse 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 <cjihrig@gmail.com>
1 parent 3e37673 commit 371ca03
Copy full SHA for 371ca03

File tree

Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-vm-static-this.js
+10-10Lines changed: 10 additions & 10 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.