summaryrefslogtreecommitdiff
path: root/bunfig.toml
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-07-26 22:13:01 +0200
committercashmere <cashmere@autistici.org>2026-07-26 22:13:01 +0200
commit3fcf892dfa19e0fb2f1487b91971f48dcc26fc50 (patch)
tree27d99b134924e9f865499564397eeba918a5b4b7 /bunfig.toml
parentfc0a801e8829b623d62137a3f7cbdec38c6d555a (diff)
downloadopencut-3fcf892dfa19e0fb2f1487b91971f48dcc26fc50.tar.gz
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.
Diffstat (limited to 'bunfig.toml')
-rw-r--r--bunfig.toml7
1 files changed, 7 insertions, 0 deletions
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"]