From 3fcf892dfa19e0fb2f1487b91971f48dcc26fc50 Mon Sep 17 00:00:00 2001 From: cashmere Date: Sun, 26 Jul 2026 22:13:01 +0200 Subject: test: preload opencut-wasm mock for bun test The published opencut-wasm package is wasm-pack bundler-target glue whose .wasm ESM import bun's test runner does not instantiate, so any test importing @/wasm failed at module evaluation. Register a faithful pure-TS stand-in (mirrors rust/crates/time semantics) via a bunfig [test] preload before any test module evaluates. --- bunfig.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 bunfig.toml (limited to 'bunfig.toml') diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 00000000..3434f708 --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,7 @@ +# The published opencut-wasm package is wasm-pack bundler-target glue that +# imports its .wasm as an ESM module with instance exports, which bun's test +# runner does not instantiate. Register a faithful pure-TS stand-in before any +# test module evaluates so tests importing `@/wasm` (directly or transitively) +# can run. See the preload file for details. +[test] +preload = ["./apps/web/src/test-utils/mock-opencut-wasm.ts"] -- cgit v1.3.1