feat(testing): refactor humanPath and add tests (#4511)

* feat: add test for humanPath

* refactor: make humanPath pure and pass in homedir
This commit is contained in:
Joe Previte
2021-11-15 19:40:34 +00:00
committed by GitHub
parent 16a5f2e171
commit 0a072f7532
5 changed files with 31 additions and 12 deletions

View File

@@ -606,7 +606,7 @@ export async function readConfigFile(configPath?: string): Promise<ConfigArgs> {
await fs.writeFile(configPath, defaultConfigFile(generatedPassword), {
flag: "wx", // wx means to fail if the path exists.
})
logger.info(`Wrote default config file to ${humanPath(configPath)}`)
logger.info(`Wrote default config file to ${humanPath(os.homedir(), configPath)}`)
} catch (error: any) {
// EEXIST is fine; we don't want to overwrite existing configurations.
if (error.code !== "EEXIST") {