Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added HOMEPATH fallback for HOME to cli tests.

The home path lookups in the cli tests were only using process.env.HOME,
which does not match the way the src/cli.js code works. This adds a
HOMEPATH fallback to match the tested functionality and support windows
systems.
  • Loading branch information...
commit e03688be7ce2ad55645163562043ec72a6e56959 1 parent f87d465
Steven Benner authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/cli.js
5 tests/cli.js
View
@@ -229,7 +229,7 @@ exports.group = {
},
testHomeRcFile: function (test) {
- var homeRc = path.join(process.env.HOME, ".jshintrc");
+ var homeRc = path.join(process.env.HOME || process.env.HOMEPATH, ".jshintrc");
var testStub = sinon.stub(shjs, "test");
var catStub = sinon.stub(shjs, "cat");
@@ -281,7 +281,8 @@ exports.group = {
},
testTargetRelativeRcLookup: function (test) {
- sinon.stub(process, "cwd").returns(process.env.HOME); // working from outside the project
+ // working from outside the project
+ sinon.stub(process, "cwd").returns(process.env.HOME || process.env.HOMEPATH);
var projectRc = __dirname + "/.jshintrc";
var srcFile = __dirname + "/sub/file.js";
var testStub = sinon.stub(shjs, "test");
Please sign in to comment.
Something went wrong with that request. Please try again.