feat(cli): add test for defaultConfigFile
This commit is contained in:
parent
fb2625dbe8
commit
77c1150b8d
@ -6,6 +6,7 @@ import * as path from "path"
|
||||
import {
|
||||
Args,
|
||||
bindAddrFromArgs,
|
||||
defaultConfigFile,
|
||||
parse,
|
||||
setDefaults,
|
||||
shouldOpenInExistingInstance,
|
||||
@ -642,3 +643,18 @@ describe("bindAddrFromArgs", () => {
|
||||
resetValue()
|
||||
})
|
||||
})
|
||||
|
||||
describe("defaultConfigFile", () => {
|
||||
it("should return the dfeault config file as a string", async () => {
|
||||
const actualDefaultConfigFile = await defaultConfigFile()
|
||||
// Since the password is autogenerated within the function
|
||||
// we can't assert it with .toMatch
|
||||
// but we can check that the config at least includes
|
||||
// these strings.
|
||||
const expectedStrings = [`bind-addr: 127.0.0.1:8080`, `auth: password`, `password`, `cert: false`]
|
||||
|
||||
expectedStrings.forEach((str) => {
|
||||
expect(actualDefaultConfigFile).toContain(str)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user