diff --git a/test/unit/node/cli.test.ts b/test/unit/node/cli.test.ts index e92cb975..9bf9fbe6 100644 --- a/test/unit/node/cli.test.ts +++ b/test/unit/node/cli.test.ts @@ -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) + }) + }) +})