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:
parent
3c6f85c282
commit
643ef1392f
@ -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([]))
|
||||||
|
Reference in New Issue
Block a user