Files
memecoin-botV2/.pnpm-store/v10/files/bf/24a062297d6e03b76002d3b3bb4ce1770328c20fb41f7901f34b53a48f80b46dde813b17a4fbb666ec2cc86c61b79001f495ab834624cdc4bb76f53944e2ae

37 lines
1.0 KiB
Plaintext

'use strict'
const test = require('node:test')
const assert = require('node:assert')
const { PassThrough } = require('node:stream')
const { sink, once } = require('./helper')
const pino = require('../')
test('Proxy and stream objects', async () => {
const s = new PassThrough()
s.resume()
s.write('', () => {})
const obj = { s, p: new Proxy({}, { get () { throw new Error('kaboom') } }) }
const stream = sink()
const instance = pino(stream)
instance.info({ obj })
const result = await once(stream, 'data')
assert.equal(result.obj, '[unable to serialize, circular reference is too complex to analyze]')
})
test('Proxy and stream objects', async () => {
const s = new PassThrough()
s.resume()
s.write('', () => {})
const obj = { s, p: new Proxy({}, { get () { throw new Error('kaboom') } }) }
const stream = sink()
const instance = pino(stream)
instance.info(obj)
const result = await once(stream, 'data')
assert.equal(result.p, '[unable to serialize, circular reference is too complex to analyze]')
})