Testing & debugging

Editors are integration-heavy: WASM adds another layer to measure and reproduce.

Overview

Pair with Editor → Testing strategies. Add WASM-specific checks for call counts, memory on large paste, and async ordering.

End-to-end tests

Drive real browsers (Playwright, Cypress) against your production bundle including WASM. Verify lazy-loaded modules actually load on first editor focus. Snapshot DOM sparingly—prefer assertions on model state exported for tests.

Profiling the boundary

Use the Performance panel: separate time in JS glue, WASM execution, and rendering. If glue dominates, reduce string copies or batch calls ( JS ↔ WASM boundary).

IME & paste in CI

Headless browsers often differ from macOS/Windows IME. Maintain a matrix of manual or device-farm tests for CJK input and mobile keyboards; automate plain-text paths in CI.

Flaky tests frequently come from timing between async WASM and input events—use explicit awaits and stable selectors.

Determinism & seeds

For CRDT or randomized fuzzing, fix seeds in Rust tests; for web, record minimal repro sequences (ops lists) to attach to bug reports.