Browse Source

test: use const and strictEqual in test-os-homedir-no-envvar

PR-URL: https://github.com/nodejs/node/pull/9899
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
CodeVana 8 years ago
committed by James M Snell
parent
commit
1b25214001
  1. 22
      test/parallel/test-os-homedir-no-envvar.js

22
test/parallel/test-os-homedir-no-envvar.js

@ -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
});

Loading…
Cancel
Save