This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

28
node_modules/pino/test/esm/named-exports.mjs generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { tmpdir, hostname } from 'os'
import t from 'tap'
import { sink, check, once, watchFileCreated, file } from '../helper.js'
import { pino, destination } from '../../pino.js'
import { join } from 'path'
import { readFileSync } from 'fs'
t.test('named exports support', async ({ equal }) => {
const stream = sink()
const instance = pino(stream)
instance.info('hello world')
check(equal, await once(stream, 'data'), 30, 'hello world')
})
t.test('destination', async ({ same }) => {
const tmp = file()
const instance = pino(destination(tmp))
instance.info('hello')
await watchFileCreated(tmp)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
pid: process.pid,
hostname,
level: 30,
msg: 'hello'
})
})