From 643ef1392f8b1f8b6601dbac8224834b00d0d9c7 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Mar 2022 16:08:07 -0700 Subject: [PATCH] testing: add new test for logLevels (#4953) * feat: add new test for logLevels * wip * feat: add test for valid log level env var --- test/unit/node/cli.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/node/cli.test.ts b/test/unit/node/cli.test.ts index ec3f5ab62..47d02aece 100644 --- a/test/unit/node/cli.test.ts +++ b/test/unit/node/cli.test.ts @@ -194,6 +194,15 @@ describe("parser", () => { 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 () => { process.env.LOG_LEVEL = "bogus" const defaults = await setDefaults(parse([]))