Skip to content

Commit

Permalink
add test for pinojs#1704
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusvellone committed May 3, 2023
1 parent 1db3cfa commit b4efe47
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/types/pino.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,15 @@ pino({
crlf: true,
});

const customLevels = { foo: 99 };

const customLevelLogger = pino({ customLevels });

type CustomLevelLogger = typeof customLevelLogger
type CustomLevelLoggerLevels = pino.Level | keyof typeof customLevels

const fn = (logger: Pick<CustomLevelLogger, CustomLevelLoggerLevels>) => {}

const customLevelChildLogger = customLevelLogger.child({ name: "child" })

fn(customLevelChildLogger); // missing foo typing

0 comments on commit b4efe47

Please # to comment.