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!
This commit is contained in:
Juan Tejada 2017-02-10 19:16:53 -08:00
parent f4dbd555d1
commit 81208062c0

View file

@ -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) {