mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 00:02:29 +00:00
* Run Vitest on Bun while preserving Node runtime contracts * Preserve runtime timing provenance and keep the Bun pin in config * Scope builtin compatibility mocks to test-only lint exceptions * Give capture retention fixtures distinct filesystem timestamps * Await the copy button success state in the React fixture * Bound Node test worker shutdown and tighten migration fixtures
21 lines
761 B
JavaScript
21 lines
761 B
JavaScript
import { parse, stringify } from 'devalue'
|
|
import { init, runBaseTests, setupEnvironment } from 'vitest/worker'
|
|
|
|
if (!process.send) {
|
|
throw new Error('Node Vitest worker requires an IPC channel')
|
|
}
|
|
const send = process.send.bind(process)
|
|
|
|
// Preserve RegExp filters and cyclic test results across Bun/Node's JSON-only IPC boundary.
|
|
init({
|
|
post: (response) => send(response),
|
|
on: (callback) => process.on('message', callback),
|
|
off: (callback) => process.off('message', callback),
|
|
serialize: stringify,
|
|
deserialize: parse,
|
|
teardown: () => process.removeAllListeners('message'),
|
|
runTests: (state, traces) => runBaseTests('run', state, traces),
|
|
collectTests: (state, traces) => runBaseTests('collect', state, traces),
|
|
setup: setupEnvironment
|
|
})
|