address review comments
This commit is contained in:
parent
7bb6ac6c60
commit
b86c3701ed
14 changed files with 149 additions and 94 deletions
10
lib/config-utils.test.js
generated
10
lib/config-utils.test.js
generated
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue