Files
2026-05-27 23:29:53 +01:00

39 lines
3.0 KiB
Markdown

# OpenSpec Change: testing-dom-spec-conformance
- **Change ID**: testing-dom-spec-conformance
- **Package**: `@suaveplan/testing-dom`
- **Status**: PROPOSED
- **Date**: 2026-04-26
## Summary
Add `**Verified by:**` lines to every requirement in `openspec/specs/testing-dom/spec.md`, add a small spec-conformance test that pins the dual-runner conditional-exports shape declared in `package.json`, and rectify the historical "retro-tick" phrasing in the archived enterprise-testing-dom tasks so `bun scripts/openspec-conformance.ts @suaveplan/testing-dom` exits 0. No public-API changes.
## Current state
`@suaveplan/testing-dom` is structurally solid: dual-runner re-exports (vitest + bun:test), `createTestConfig()` factory with WSL2-safe defaults and dynamic `@vitejs/plugin-react` loading, side-effect-only polyfills, jest-dom matcher extension, `renderComponent` wrapper with auto-cleanup and `userEvent`, accessibility-first query aliases, structured `TestingDomError` hierarchy with stable codes, dep-graph + tree-shake + no-disallowed guards, and `instrumented()` OTel wrapper. All 63 tests pass under vitest. The conformance gaps are documentary plus one unwritten test scenario:
- 9/9 requirements lack `**Verified by:**` lines.
- "Dual-runner conditional exports preserved" — the spec asserts `package.json#exports` routes the `vitest` + `default` conditions to one barrel and the `bun` condition to the bun-test barrel, but no test pins the JSON shape, so a regression in the exports map would slip past the test suite.
- `tasks.md` of `2026-04-19-enterprise-testing-dom/` carries the legacy retro-tick phrasing the conformance script flags.
- The Coverage section path-references `packages/universal/testing-dom/src/`; the package now lives at `packages/dev/testing-dom/src/` after the domain-first reorg. (Documentary fix only — coverage gate already runs against the correct path.)
## What changes
1. Add `**Verified by:**` line under every `### Requirement:` block in `openspec/specs/testing-dom/spec.md`.
2. Update the path reference inside the "Coverage and docs gates" requirement from `packages/universal/testing-dom/src/` to `packages/dev/testing-dom/src/`.
3. Add `tests/exports-map.spec-conformance.test.ts` that parses `package.json` and pins:
- `exports["."]["vitest"].default === "./dist/index.js"`
- `exports["."]["default"].default === "./dist/index.js"`
- `exports["."]["bun"].default === "./dist/runner/bun-test.js"`
- `./polyfills`, `./matchers`, `./config`, `./errors`, `./render`, `./queries`, `./user` subpaths exist.
4. Replace the legacy retro-tick phrase in `openspec/archive/2026-04-19-enterprise-testing-dom/tasks.md` with a neutral note pointing at this change.
5. Re-run `bun scripts/openspec-conformance.ts @suaveplan/testing-dom` and confirm exit 0.
## Impact
- Public API unchanged.
- One new test file (~40 lines).
- `openspec/specs/testing-dom/spec.md` gains 9 `**Verified by:**` lines and one corrected path reference.
- `openspec/archive/2026-04-19-enterprise-testing-dom/tasks.md` rephrased to drop the conformance-blocking phrase.