Summary
Add a test system — Vitest for unit tests and Playwright for browser-level smoke tests; wire up npm test
Environment
- Product/Service: FeatureSET-Display — Testing infrastructure
- Files:
package.json, new tests/ directory
Problem Description
No tests exist today. There is no npm test script, no unit tests, and no automated verification that the wasm module loads correctly in a browser context. Changes to the native or JS layer cannot be validated before merging.
Expected Behavior
npm test runs the full test suite.
- Unit tests cover JS-layer logic (gray → RGBA conversion, event dispatch, API methods).
- A browser-level smoke test loads a known marker file and asserts the canvas is non-empty after processing.
- Tests are fast enough to run in CI on every PR.
Actual Behavior
No tests exist. No npm test script. No CI validation.
Tasks
Impact
High (long-term) — Without tests, regressions from any of the other roadmap changes cannot be caught automatically. Should be added before or alongside the major cleanup work (2d, 3a, 3b).
Additional Context
Vitest is recommended over Jest for its native ESM support and speed. Playwright is recommended for browser tests because it can run a real wasm module in a headless Chromium — jsdom cannot execute wasm. A single end-to-end smoke test covering marker load + canvas output provides the highest confidence with the least maintenance burden to start.
Dependencies: Toolchain refresh (3a) should land first so tests run against the updated build output.
Summary
Add a test system — Vitest for unit tests and Playwright for browser-level smoke tests; wire up
npm testEnvironment
package.json, newtests/directoryProblem Description
No tests exist today. There is no
npm testscript, no unit tests, and no automated verification that the wasm module loads correctly in a browser context. Changes to the native or JS layer cannot be validated before merging.Expected Behavior
npm testruns the full test suite.Actual Behavior
No tests exist. No
npm testscript. No CI validation.Tasks
src/ARFset.js, API method contracts)npm testscript topackage.jsonImpact
High (long-term) — Without tests, regressions from any of the other roadmap changes cannot be caught automatically. Should be added before or alongside the major cleanup work (2d, 3a, 3b).
Additional Context
Vitest is recommended over Jest for its native ESM support and speed. Playwright is recommended for browser tests because it can run a real wasm module in a headless Chromium — jsdom cannot execute wasm. A single end-to-end smoke test covering marker load + canvas output provides the highest confidence with the least maintenance burden to start.
Dependencies: Toolchain refresh (3a) should land first so tests run against the updated build output.