mirror of
https://github.com/anomalyco/opentui.git
synced 2026-09-19 01:26:03 +08:00
a70f18026a
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.
17 lines
372 B
JavaScript
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)
|
|
},
|
|
})
|