Files
klz-cables.com/.pnpm-store/v10/files/47/80befab58ccb0dcf8a93c759ccfbd7517c526c899bec659f286b8685075d16167202cb9ce83396d319bd7caca1bfe2bee81fe978239fc0e8b75703061d6567
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

61 lines
1.3 KiB
Plaintext

'use strict'
const { test } = require('tap')
const { join } = require('path')
const { file } = require('./helper')
const ThreadStream = require('..')
test('bundlers support with .js file', function (t) {
t.plan(1)
globalThis.__bundlerPathsOverrides = {
'thread-stream-worker': join(__dirname, 'custom-worker.js')
}
const dest = file()
process.on('uncaughtException', error => {
console.log(error)
})
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.js'),
workerData: { dest },
sync: true
})
stream.worker.removeAllListeners('message')
stream.worker.once('message', message => {
t.equal(message.code, 'CUSTOM-WORKER-CALLED')
})
stream.end()
})
test('bundlers support with .mjs file', function (t) {
t.plan(1)
globalThis.__bundlerPathsOverrides = {
'thread-stream-worker': join(__dirname, 'custom-worker.js')
}
const dest = file()
process.on('uncaughtException', error => {
console.log(error)
})
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.mjs'),
workerData: { dest },
sync: true
})
stream.worker.removeAllListeners('message')
stream.worker.once('message', message => {
t.equal(message.code, 'CUSTOM-WORKER-CALLED')
})
stream.end()
})