From a953c77086684f77b8fd9b0d546eb2808beba50e Mon Sep 17 00:00:00 2001 From: Zirak Date: Tue, 1 Oct 2019 19:04:20 +0000 Subject: [PATCH] Handle formatting a Symbol Bump up the minimum `quick-format-unescaped` version, and test passing a Symbol as a format argument. Fix #715. --- package.json | 2 +- test/basic.test.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d89ad248c..4822cc160 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "fast-safe-stringify": "^2.0.7", "flatstr": "^1.0.9", "pino-std-serializers": "^2.3.0", - "quick-format-unescaped": "^3.0.2", + "quick-format-unescaped": "^3.0.3", "sonic-boom": "^0.7.5" } } diff --git a/test/basic.test.js b/test/basic.test.js index e4ff500cf..a83c6e52c 100644 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -107,6 +107,19 @@ function levelTest (name, level) { check(is, result, level, 'hello 42') }) + test(`formatting a symbol at level ${name}`, async ({ is }) => { + const stream = sink() + const instance = pino(stream) + instance.level = name + + const sym = Symbol('foo') + instance[name]('hello', sym) + + const result = await once(stream, 'data') + + check(is, result, level, 'hello Symbol(foo)') + }) + test(`passing error with a serializer at level ${name}`, async ({ is, same }) => { const stream = sink() const err = new Error('myerror')