Files
veilid/veilid-wasm/tests/src/workers/dedicated.worker.ts
T
2026-09-13 13:42:03 -04:00

17 lines
651 B
TypeScript

// A static top-level `import 'veilid-wasm'` hangs wasm instantiation in vite-bundled module
// workers, so the suite graph is pulled in on demand instead.
self.onmessage = async (e: MessageEvent) => {
if (e.data?.type !== 'run') {
return;
}
const step = (s: string) => self.postMessage({ type: 'progress', step: s });
try {
const { runSuites } = await import('../harness/run-suites.js');
const results = await runSuites(e.data.suites, 'dedicated', step, e.data.caseFilter);
self.postMessage({ type: 'done', ok: true, results });
} catch (err) {
self.postMessage({ type: 'done', ok: false, error: String(err) });
}
};