diff --git a/test/basic.test.js b/test/basic.test.js index 3984f9fb..77c53e99 100644 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -6,6 +6,7 @@ const test = require('tap').test const pino = require('pino') const dateformat = require('dateformat') const _prettyFactory = require('../') +const chalk = require('chalk') function prettyFactory (opts) { if (!opts) { @@ -710,7 +711,7 @@ test('basic prettifier tests', (t) => { const log = pino({}, new Writable({ write (chunk, enc, cb) { const formatted = pretty(chunk.toString()) - t.is(formatted, `[${epoch}] INFO (${pid} on ${hostname}): message {"extra":{"foo":"bar","number":42},"upper":"FOOBAR"}\n`) + t.is(formatted, `[${epoch}] INFO (${pid} on ${hostname}): message ${chalk.gray('{"extra":{"foo":"bar","number":42},"upper":"FOOBAR"}')}\n`) cb() } diff --git a/test/error-objects.test.js b/test/error-objects.test.js index e2c5cc91..7e44262b 100644 --- a/test/error-objects.test.js +++ b/test/error-objects.test.js @@ -4,6 +4,7 @@ const Writable = require('stream').Writable const os = require('os') const test = require('tap').test const pino = require('pino') +const chalk = require('chalk') const serializers = pino.stdSerializers const _prettyFactory = require('../') @@ -133,7 +134,7 @@ test('error like objects tests', (t) => { const formatted = pretty(chunk.toString()) const lines = formatted.split('\n') t.is(lines.length, expected.length + 5) - t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): {"extra":{"a":1,"b":2}}`) + t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): ${chalk.gray('{"extra":{"a":1,"b":2}}')}`) t.match(lines[1], /\s{4}err: {/) t.match(lines[2], /\s{6}"type": "Error",/) t.match(lines[3], /\s{6}"message": "hello world",/)