Skip to content

Commit 3917090

Browse files
test: document compatibility test taxonomy
## Problem This PR has no runtime or runner behavior change; it reduces maintenance risk by giving compatibility tests an explicit routing note before a dedicated compatibility suite exists. Compatibility coverage currently lives across broad specs such as `version-sensitive.ts`, `watch.ts`, `cli.ts`, `api.ts`, and `smoke.ts`. Without a small taxonomy, new Node-version-sensitive tests can keep piling into the wrong catch-all file or imply that `tests/specs/compat/` is already wired as an executable suite. ## Changes - Adds `tests/specs/compat/README.md` as a routing skeleton, not runner wiring. - Documents the current routes for loader-hook composition, watch and CLI behavior, CommonJS-classified TypeScript contracts, CJS namespace and `require(esm)`, path/query resolution, `import.meta` path properties, package `main` resolution, and Node test runner behavior. - Directs new compatibility coverage to the narrowest existing spec until the dedicated compatibility suite boundary is intentional.
1 parent de8113f commit 3917090

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/specs/compat/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Compatibility Test Routing
2+
3+
This directory is a routing note and future split point for capability and strategy compatibility tests. It does not reorganize current tests, add runner wiring, or move coverage out of the existing specs.
4+
5+
Until the compatibility suite is wired, keep executable tests in the narrowest existing spec and update this note when a new compatibility domain appears.
6+
7+
## Current Domains
8+
9+
| Domain | Current route | Notes |
10+
| --- | --- | --- |
11+
| `registerHooks` composition | `tests/specs/version-sensitive.ts` | Use for Node loader hook composition that depends on newer `node:module` support. |
12+
| Watch and CLI Node-version behavior | `tests/specs/version-sensitive.ts`, `tests/specs/watch.ts`, `tests/specs/cli.ts` | Keep stable command behavior in `watch.ts` or `cli.ts`; use `version-sensitive.ts` for matrix-specific behavior. |
13+
| CommonJS-classified TypeScript contracts | `tests/specs/version-sensitive.ts`, `tests/specs/commonjs-mode-contracts.ts` | Use `version-sensitive.ts` for Node-dependent ESM import and `tsImport` contracts; use `commonjs-mode-contracts.ts` for omitted `type` versus explicit `commonjs` equivalence. |
14+
| CJS namespace and `require(esm)` behavior | `tests/specs/version-sensitive.ts` | Use for namespace shape, `module.exports` interop, and extensionless `.mjs` resolution across Node versions. |
15+
| Path encoding and query resolution | `tests/specs/version-sensitive.ts`, `tests/specs/smoke.ts`, `tests/specs/api.ts` | Use for literal question marks, query strings, namespace query parameters, and path alias query resolution. |
16+
| `import.meta` path properties | `tests/specs/version-sensitive.ts` | Use for Node file-module support such as `import.meta.dirname` and `import.meta.filename`. |
17+
| Package `main` resolution | `tests/specs/version-sensitive.ts`, `tests/specs/commonjs-mode-contracts.ts` | Use `version-sensitive.ts` for Node-version boundaries and `commonjs-mode-contracts.ts` for CommonJS mode parity. |
18+
| Node test runner behavior | `tests/specs/version-sensitive.ts`, `tests/specs/cli.ts` | Keep the baseline `--test` CLI contract in `cli.ts`; use `version-sensitive.ts` for Node-version output or glob differences. |
19+
20+
## Routing Rule
21+
22+
New compatibility tests should start in the current route for their domain. Add executable specs under `tests/specs/compat/` only when the runner has an intentional compatibility suite boundary, so this directory stays a taxonomy skeleton instead of an accidental test reorganization.

0 commit comments

Comments
 (0)