test(phase22): align runner export/guard parity for core token suite

This commit is contained in:
2026-03-25 10:34:34 +00:00
parent d7874686a1
commit 7553f992b7
2 changed files with 34 additions and 4 deletions
+26
View File
@@ -2175,3 +2175,29 @@ Validation:
Follow-ups:
- Optional next bounded slice: add this phase22 suite to any aggregate test runner used in CI if/when phase-level suites are centrally orchestrated.
---
### CL-062: TASK22260 next slice — phase22 runner export guard parity (bounded test-harness consistency)
date: 2026-03-25
author: Cline
scope: `tests/phase22/core-token-behaviour.test.cjs`
type: change
rationale: Continue bounded test-hardening by aligning phase22 test entry behavior with established suite conventions so it can be executed both directly and from aggregate runners.
impact: Improves test harness composability and reduces accidental double-execution risk when importing phase22 test suites.
status: completed
Summary:
- Updated `tests/phase22/core-token-behaviour.test.cjs` to export `run` and add `require.main === module` guard.
- Preserved direct CLI execution behavior while enabling safe module import by aggregate runners.
Validation:
- `node tests/phase22/core-token-behaviour.test.cjs` -> pass (2/2)
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Optional next bounded slice: add a dedicated `tests/phase22/index.test.cjs` aggregate entrypoint if additional phase22 suites are introduced.
+8 -4
View File
@@ -104,7 +104,11 @@ const run = async () => {
);
};
run().catch((error) => {
console.error(error);
process.exit(1);
});
module.exports = run;
if (require.main === module) {
run().catch((error) => {
console.error(error);
process.exit(1);
});
}