650 B
650 B
Testing — Q-Edit
Stack
- Vitest with jsdom for DOM-related tests.
- Coverage via v8 with thresholds Lines 70 / Branches 70 / Functions 50 / Statements 70.
Conventions
- Place tests under
tests/with suffix.test.mjsor.spec.mjs. - Keep tests deterministic; avoid real sleeps. For pure utils, test inputs/outputs.
- For DOM tests, load
index.htmland assert on key elements (smoke tests).
Commands
npm test— run once with coveragenpm run test:watch— watch mode
Roadmap
- As we extract modules from
script.js, add unit tests per module. - Later: E2E with Playwright (mock network via MSW).