Archived
1
0

testing: add new test for logLevels (#4953)

* feat: add new test for logLevels

* wip

* feat: add test for valid log level env var
This commit is contained in:
Joe Previte 2022-03-07 16:08:07 -07:00 committed by GitHub
parent 3c6f85c282
commit 643ef1392f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,6 +194,15 @@ describe("parser", () => {
expect(logger.level).toEqual(Level.Trace) expect(logger.level).toEqual(Level.Trace)
}) })
it("should set valid log level env var", async () => {
process.env.LOG_LEVEL = "error"
const defaults = await setDefaults(parse([]))
expect(defaults).toEqual({
...defaults,
log: "error",
})
})
it("should ignore invalid log level env var", async () => { it("should ignore invalid log level env var", async () => {
process.env.LOG_LEVEL = "bogus" process.env.LOG_LEVEL = "bogus"
const defaults = await setDefaults(parse([])) const defaults = await setDefaults(parse([]))