address review comments

This commit is contained in:
Robert Brignull 2020-07-15 17:36:49 +01:00
parent 7bb6ac6c60
commit b86c3701ed
14 changed files with 149 additions and 94 deletions

View file

@ -58,7 +58,7 @@ ava_1.default("load empty config", async (t) => {
},
});
const config = await configUtils.initConfig();
t.deepEqual(config, await configUtils.getBlankConfig());
t.deepEqual(config, await configUtils.getDefaultConfig());
});
});
ava_1.default("loading config saves config", async (t) => {
@ -77,11 +77,13 @@ ava_1.default("loading config saves config", async (t) => {
},
});
// Sanity check the saved config file does not already exist
t.false(fs.existsSync(configUtils.getParsedConfigFile()));
t.false(fs.existsSync(configUtils.getPathToParsedConfigFile()));
// Sanity check that getConfig throws before we have called initConfig
t.throwsAsync(configUtils.getConfig);
const config1 = await configUtils.initConfig();
// The saved config file should now exist
t.true(fs.existsSync(configUtils.getParsedConfigFile()));
// And the same config should be returned again
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile()));
// And that same newly-initialised config should now be returned by getConfig
const config2 = await configUtils.getConfig();
t.deepEqual(config1, config2);
});