-
Notifications
You must be signed in to change notification settings - Fork 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use pino/file instead of pino-pretty for caller transport tests
This is due to pinojs/pino-pretty#304 which might trigger under severe load and short-lived scripts. The fix on pino-pretty will happen on its own time but there is no need to use pino-pretty in these tests. Fixes #1368
- Loading branch information
Showing
3 changed files
with
8 additions
and
38 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,53 +1,23 @@ | ||
'use strict' | ||
|
||
const writer = require('flush-write-stream') | ||
const { join } = require('path') | ||
const { test } = require('tap') | ||
const execa = require('execa') | ||
|
||
const { once } = require('../helper') | ||
|
||
test('when using a custom transport outside node_modules, the first file outside node_modules should be used', async function (t) { | ||
const evalApp = join(__dirname, '../', '/fixtures/eval/index.js') | ||
const child = execa(process.argv[0], [evalApp]) | ||
|
||
let actual = '' | ||
child.stdout.pipe(writer((s, enc, cb) => { | ||
actual += s | ||
cb() | ||
})) | ||
|
||
await once(child, 'close') | ||
|
||
t.match(actual, /done!/) | ||
const { stdout } = await execa(process.argv[0], [evalApp]) | ||
t.match(stdout, /done!/) | ||
}) | ||
|
||
test('when using a custom transport where some files in stacktrace are in the node_modules, the first file outside node_modules should be used', async function (t) { | ||
const evalApp = join(__dirname, '../', '/fixtures/eval/node_modules/2-files.js') | ||
const child = execa(process.argv[0], [evalApp]) | ||
|
||
let actual = '' | ||
child.stdout.pipe(writer((s, enc, cb) => { | ||
actual += s | ||
cb() | ||
})) | ||
|
||
await once(child, 'close') | ||
|
||
t.match(actual, /done!/) | ||
const { stdout } = await execa(process.argv[0], [evalApp]) | ||
t.match(stdout, /done!/) | ||
}) | ||
|
||
test('when using a custom transport where all files in stacktrace are in the node_modules, the first file inside node_modules should be used', async function (t) { | ||
const evalApp = join(__dirname, '../', '/fixtures/eval/node_modules/14-files.js') | ||
const child = execa(process.argv[0], [evalApp]) | ||
|
||
let actual = '' | ||
child.stdout.pipe(writer((s, enc, cb) => { | ||
actual += s | ||
cb() | ||
})) | ||
|
||
await once(child, 'close') | ||
|
||
t.match(actual, /done!/) | ||
const { stdout } = await execa(process.argv[0], [evalApp]) | ||
t.match(stdout, /done!/) | ||
}) |