Skip to content

Commit 3ffa6a8

Browse files
wzoomjasnell
authored andcommitted
test: modernize js and tighten equality checking
Changed var --> const and let. Changed assert.notEqual --> assert.notStrictEqual Fixed comment spelling PR-URL: #8618 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 00dd33c commit 3ffa6a8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/parallel/test-child-process-cwd.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

5-
var returns = 0;
5+
let returns = 0;
66

77
/*
88
Spawns 'pwd' with given options, then test
99
- whether the exit code equals forCode,
1010
- optionally whether the stdout result matches forData
11-
(after removing traling whitespace)
11+
(after removing trailing whitespace)
1212
*/
1313
function testCwd(options, forCode, forData) {
14-
var data = '';
14+
let data = '';
1515

16-
var child = common.spawnPwd(options);
16+
const child = common.spawnPwd(options);
1717

1818
child.stdout.setEncoding('utf8');
1919

@@ -46,7 +46,7 @@ if (common.isWindows) {
4646
// Assume does-not-exist doesn't exist, expect exitCode=-1 and errno=ENOENT
4747
{
4848
testCwd({cwd: 'does-not-exist'}, -1).on('error', common.mustCall(function(e) {
49-
assert.equal(e.code, 'ENOENT');
49+
assert.strictEqual(e.code, 'ENOENT');
5050
}));
5151
}
5252

@@ -58,7 +58,7 @@ testCwd({cwd: undefined}, 0);
5858
testCwd({cwd: null}, 0);
5959

6060
// Check whether all tests actually returned
61-
assert.notEqual(0, returns);
61+
assert.notStrictEqual(returns, 0);
6262
process.on('exit', function() {
63-
assert.equal(0, returns);
63+
assert.strictEqual(returns, 0);
6464
});

0 commit comments

Comments
 (0)