From 79884274ae2f48006b693bb5909db18de49c415b Mon Sep 17 00:00:00 2001 From: Kevin Partington Date: Fri, 1 Jul 2016 08:38:39 -0500 Subject: [PATCH] Fix: lib/config.js tests pass if personal config exists (fixes #6559) (#6566) --- tests/lib/config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/lib/config.js b/tests/lib/config.js index 4a01f15cbe5..dafc298a981 100644 --- a/tests/lib/config.js +++ b/tests/lib/config.js @@ -264,7 +264,11 @@ describe("Config", function() { it("should throw an error when an invalid path is given", function() { var configPath = path.resolve(__dirname, "..", "fixtures", "configurations", "foobaz", ".eslintrc"); - var configHelper = new Config({cwd: process.cwd()}); + var homePath = "does-not-exist"; + + var StubbedConfig = proxyquire("../../lib/config", { "user-home": homePath }); + + var configHelper = new StubbedConfig({cwd: process.cwd()}); sandbox.stub(fs, "readdirSync").throws(new Error());