From 81208062c0c3b77d3c6fefbb88e2cd5b05c6df1d Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Fri, 10 Feb 2017 19:16:53 -0800 Subject: [PATCH] fix(specs) Correctly set `configDirPath` when running tests Before this commit, running the running the tests would clear all of your config inside `.nylas-dev` and thus your accounts, forcing you to re-add them everytime after you ran the tests This was happening because we weren't correctly setting the `configDirPath` to `.nylas-spec` when running with the --test flag. When we run with --test, both options, `specMode` and `devMode` are true, so the logic to set the path would fall into both conditions and ultimately set the path to `.nylas-dev`. Now it's fixed! --- src/browser/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/browser/main.js b/src/browser/main.js index c23e67c84..ea8927b3c 100644 --- a/src/browser/main.js +++ b/src/browser/main.js @@ -17,8 +17,12 @@ if (typeof process.setFdLimit === 'function') { const setupConfigDir = (args) => { let defaultDirName = ".nylas-mail"; - if (args.specMode) defaultDirName = ".nylas-spec"; - if (args.devMode) defaultDirName = ".nylas-dev"; + if (args.devMode) { + defaultDirName = ".nylas-dev"; + } + if (args.specMode) { + defaultDirName = ".nylas-spec"; + } let configDirPath = path.join(app.getPath('home'), defaultDirName); if (args.configDirPath) {