Archived
1
0

Merge pull request #4309 from cdr/jsjoeio-test-monday

feat(cli): add tests for password, hashed-password
This commit is contained in:
Joe Previte 2021-10-05 11:14:07 -07:00 committed by GitHub
commit 271bc06754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,6 +333,18 @@ describe("parser", () => {
})
})
it("should error if password passed in", () => {
expect(() => parse(["--password", "supersecret123"])).toThrowError(
"--password can only be set in the config file or passed in via $PASSWORD",
)
})
it("should error if hashed-password passed in", () => {
expect(() => parse(["--hashed-password", "fdas423fs8a"])).toThrowError(
"--hashed-password can only be set in the config file or passed in via $HASHED_PASSWORD",
)
})
it("should filter proxy domains", async () => {
const args = parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "coder.com", "--proxy-domain", "coder.org"])
expect(args).toEqual({