Explore
Sign In
skills/anomalyco__opentui
1
0
Fork 0
You've already forked anomalyco__opentui
mirror of https://github.com/anomalyco/opentui.git synced 2026-09-19 01:26:03 +08:00
Code Issues Packages Projects Releases Wiki Activity
Files
4954312d749f71e80664aa8b0e8a75384186eb99
anomalyco__opentui/packages/core/scripts/test-node-hook.mjs
T

17 lines
372 B
JavaScript
Raw Normal View History

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-05-12 12:02:58 +02:00
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)
},
})
Reference in New Issue Copy Permalink
Version: v1.25.5 Page: 828ms Template: 2ms
Auto
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어