Skip to content

Commit

Permalink
Merge pull request #717 from Zirak/symbol-support
Browse files Browse the repository at this point in the history
Handle formatting a Symbol
  • Loading branch information
davidmarkclements committed Oct 1, 2019
2 parents c0dc89d + a953c77 commit a9ca301
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
}
}
13 changes: 13 additions & 0 deletions test/basic.test.js
Expand Up @@ -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')
Expand Down

0 comments on commit a9ca301

Please sign in to comment.