Skip to content

Commit

Permalink
Fix failing test - Allow censor function (#551)
Browse files Browse the repository at this point in the history
* Fix failing test - Allow censor function

`fast-redact` allows the `censor` option to be a function starting in version `1.4.0`.

* Remove censor validation error message
  • Loading branch information
nwoltman authored and mcollina committed Nov 22, 2018
1 parent 220e3d0 commit d65c0d1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/redaction.js
Expand Up @@ -5,7 +5,6 @@ const { redactFmtSym } = require('./symbols')
const { rx, validator } = fastRedact

const validate = validator({
ERR_CENSOR_MUST_NOT_BE_FUNCTION: () => 'pino – censor option may not be a function',
ERR_PATHS_MUST_BE_STRINGS: () => 'pino – redacted paths must be strings',
ERR_INVALID_PATH: (s) => `pino – redact paths array contains an invalid path (${s})`
})
Expand Down
6 changes: 0 additions & 6 deletions test/redact.test.js
Expand Up @@ -40,12 +40,6 @@ test('redact.paths option – throws if array contains an invalid path', async (
})
})

test('redact.censor option – throws if censor is a function', async ({ throws }) => {
throws(() => {
pino({ redact: { paths: ['req.headers.cookie'], censor: () => {} } })
})
})

test('redact option – top level key', async ({ is }) => {
const stream = sink()
const instance = pino({ redact: ['key'] }, stream)
Expand Down

0 comments on commit d65c0d1

Please sign in to comment.