Files
Simon Klee a70f18026a core: port test suite and runtime to Node.js
The test suite was tightly coupled to Bun-specific APIs (bun:test,
Bun.sleep) making it impossible to validate behavior on other
runtimes. A module hook now rewrites bun:test imports for Node's
test runner, and fake clocks replace wall-clock delays so tests
run deterministically everywhere.

Fix FFI type mismatches and boolean normalization that caused
silent failures on non-Bun runtimes. Correct bundled asset
resolution so published packages load without a TypeScript loader.

Reorganize the example menu with themed sections, two-panel focus
management, and proper tree-sitter cleanup to prevent worker leaks.
2026-06-08 12:20:40 +02:00

17 lines
372 B
JavaScript

import { registerHooks } from "node:module"
const bunTestUrl = new URL("../.node-test/src/testing/bun-test-node.js", import.meta.url).href
registerHooks({
resolve(specifier, context, nextResolve) {
if (specifier === "bun:test") {
return {
shortCircuit: true,
url: bunTestUrl,
}
}
return nextResolve(specifier, context)
},
})