Files
klz-cables.com/.pnpm-store/v10/files/95/a02afd5527269a7b9a70e3bfc7709e6a7165839afc6d2cc54a988eabf75733f94015ab5338e985f7254db821475bc8a2bcb10228fb287fba5e6c00a588b2d0
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

88 lines
1.7 KiB
Plaintext

'use strict'
const test = require('tape')
const pino = require('../browser')
test('set browser opts disabled to true', ({ end, same }) => {
const instance = pino({
browser: {
disabled: true,
write (actual) {
checkLogObjects(same, actual, [])
}
}
})
instance.info('hello world')
instance.error('this is an error')
instance.fatal('this is fatal')
end()
})
test('set browser opts disabled to false', ({ end, same }) => {
const expected = [
{
level: 30,
msg: 'hello world'
},
{
level: 50,
msg: 'this is an error'
},
{
level: 60,
msg: 'this is fatal'
}
]
const instance = pino({
browser: {
disabled: false,
write (actual) {
checkLogObjects(same, actual, expected.shift())
}
}
})
instance.info('hello world')
instance.error('this is an error')
instance.fatal('this is fatal')
end()
})
test('disabled is not set in browser opts', ({ end, same }) => {
const expected = [
{
level: 30,
msg: 'hello world'
},
{
level: 50,
msg: 'this is an error'
},
{
level: 60,
msg: 'this is fatal'
}
]
const instance = pino({
browser: {
write (actual) {
checkLogObjects(same, actual, expected.shift())
}
}
})
instance.info('hello world')
instance.error('this is an error')
instance.fatal('this is fatal')
end()
})
function checkLogObjects (same, actual, expected, is) {
const actualCopy = Object.assign({}, actual)
const expectedCopy = Object.assign({}, expected)
delete actualCopy.time
delete expectedCopy.time
same(actualCopy, expectedCopy)
}