Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/wa.picotech.app/public_html/node_modules/pino/test/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict'
const { test } = require('tap')
const { join } = require('path')
const execa = require('execa')
const writer = require('flush-write-stream')
const { once } = require('./helper')
// https://github.com/pinojs/pino/issues/542
test('pino.destination log everything when calling process.exit(0)', async ({ not }) => {
let actual = ''
const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'destination-exit.js')])
child.stdout.pipe(writer((s, enc, cb) => {
actual += s
cb()
}))
await once(child, 'close')
not(actual.match(/hello/), null)
not(actual.match(/world/), null)
})
test('pino with no args log everything when calling process.exit(0)', async ({ not }) => {
let actual = ''
const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'default-exit.js')])
child.stdout.pipe(writer((s, enc, cb) => {
actual += s
cb()
}))
await once(child, 'close')
not(actual.match(/hello/), null)
not(actual.match(/world/), null)
})
const hasWeak = !!global.WeakRef
test('sync false does not log everything when calling process.exit(0)', { skip: hasWeak }, async ({ equal }) => {
let actual = ''
const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'syncfalse-exit.js')])
child.stdout.pipe(writer((s, enc, cb) => {
actual += s
cb()
}))
await once(child, 'close')
equal(actual.match(/hello/), null)
equal(actual.match(/world/), null)
})
test('sync false logs everything when calling process.exit(0)', { skip: !hasWeak }, async ({ not }) => {
let actual = ''
const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'syncfalse-exit.js')])
child.stdout.pipe(writer((s, enc, cb) => {
actual += s
cb()
}))
await once(child, 'close')
not(actual.match(/hello/), null)
not(actual.match(/world/), null)
})
test('sync false logs everything when calling flushSync', async ({ not }) => {
let actual = ''
const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'syncfalse-flush-exit.js')])
child.stdout.pipe(writer((s, enc, cb) => {
actual += s
cb()
}))
await once(child, 'close')
not(actual.match(/hello/), null)
not(actual.match(/world/), null)
})
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0147 ]-- |