Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the test with const and strictEqual #9899

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions test/parallel/test-os-homedir-no-envvar.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var cp = require('child_process');
var os = require('os');
var path = require('path');
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const os = require('os');
const path = require('path');


if (process.argv[2] === 'child') {
if (common.isWindows)
assert.equal(process.env.USERPROFILE, undefined);
assert.strictEqual(process.env.USERPROFILE, undefined);
else
assert.equal(process.env.HOME, undefined);
assert.strictEqual(process.env.HOME, undefined);

var home = os.homedir();
const home = os.homedir();

assert.ok(typeof home === 'string');
assert.ok(home.indexOf(path.sep) !== -1);
assert.strictEqual(typeof home, 'string');
assert(home.includes(path.sep));
} else {
if (common.isWindows)
delete process.env.USERPROFILE;
else
delete process.env.HOME;

var child = cp.spawnSync(process.execPath, [__filename, 'child'], {
const child = cp.spawnSync(process.execPath, [__filename, 'child'], {
env: process.env
});

Expand Down