Skip to content

Commit

Permalink
refactor(log): prepare for noUncheckedIndexedAccess (#4482)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabelluardo authored Mar 14, 2024
1 parent 1dc1ae5 commit 1040fb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions log/logger_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Deno.test("Logger handles custom handler", () => {

const inlineData: string = logger.debug("foo", 1, 2);

const record = handler.records[0];
const record = handler.records[0]!;
assertEquals(record.msg, "foo");
assertEquals(record.args, [1, 2]);
assertEquals(record.level, LogLevels.DEBUG);
Expand Down Expand Up @@ -267,8 +267,8 @@ Deno.test(
const error = new RangeError("Uh-oh!");
const data21: RangeError = logger.error(error);
assertEquals(data21, error);
const messages21 = handler.messages[20].split("\n");
assertEquals(messages21[0], `ERROR ${error.name}: ${error.message}`);
assertMatch(messages21[1], /^\s+at file:.*\d+:\d+$/);
const messages21 = handler.messages[20]!.split("\n");
assertEquals(messages21[0]!, `ERROR ${error.name}: ${error.message}`);
assertMatch(messages21[1]!, /^\s+at file:.*\d+:\d+$/);
},
);
2 changes: 1 addition & 1 deletion log/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Deno.test("setup() handles default handlers", async function () {
continue;
}

const logger = loggers[levelName];
const logger = loggers[levelName]!;
const handler = new TestHandler(levelName);

await log.setup({
Expand Down

0 comments on commit 1040fb4

Please sign in to comment.