Files
klz-cables.com/.pnpm-store/v10/files/e0/cdbe9a7a071391f2dc391e8436438e9302608abad3ee6b2de21d6692172c97514b77ef005f0a4fecb2f7f57cbfd28da85880bcdb86d7eb22ea66f6da24d43b
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

24 lines
774 B
Plaintext

'use strict'
const test = require('tape-promise').default(require('tape'))
const { Readable } = require('stream')
const streamToPromise = require('stream-to-promise')
const Encoder = require('./encoder')
test('encoder', (t) => {
t.test('empty input gives empty result', async (t) => {
const result = await streamToPromise(Readable.from([]).pipe(new Encoder()))
t.equal(result.toString(), '\\\\x')
})
t.test('input cuts at chunk boundary multiple ways', async (t) => {
const input = [0x12, 0x34, 0x56]
for (let i = 1; i < input.length; i++) {
const result = await streamToPromise(Readable.from([input.slice(0, i), input.slice(i)].map(Buffer.from)).pipe(new Encoder()))
t.equal(result.toString(), '\\\\x123456')
}
t.end()
})
})