-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict' | ||
const { test } = require('tap') | ||
const { sink, once } = require('./helper') | ||
const stdSerializers = require('pino-std-serializers') | ||
const pino = require('../') | ||
|
||
test('set the errorKey with error serializer', async ({ equal, same }) => { | ||
const stream = sink() | ||
const errorKey = 'error' | ||
const instance = pino({ | ||
errorKey, | ||
serializers: { [errorKey]: stdSerializers.err } | ||
}, stream) | ||
instance.error(new ReferenceError('test')) | ||
const o = await once(stream, 'data') | ||
equal(typeof o[errorKey], 'object') | ||
equal(o[errorKey].type, 'ReferenceError') | ||
equal(o[errorKey].message, 'test') | ||
equal(typeof o[errorKey].stack, 'string') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters