From b79c867259f1b97787935dc7311745b4bf165e95 Mon Sep 17 00:00:00 2001 From: Steven Li Date: Sun, 9 Jun 2024 15:06:49 -0700 Subject: [PATCH] Added test case for setting child logger level at creation time (#960) --- test/browser-child.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/browser-child.test.js b/test/browser-child.test.js index 0ed1dd515..db80e7ee1 100644 --- a/test/browser-child.test.js +++ b/test/browser-child.test.js @@ -14,6 +14,18 @@ test('child has parent level', ({ end, same, is }) => { end() }) +test('child can set level at creation time', ({ end, same, is }) => { + const instance = pino({ + level: 'error', + browser: {} + }) + + const child = instance.child({}, { level: 'info' }) // first bindings, then options + + same(child.level, 'info') + end() +}) + test('changing child level does not affect parent', ({ end, same, is }) => { const instance = pino({ level: 'error',