test(core): add bounded regression coverage for token request client

This commit is contained in:
2026-03-25 10:30:39 +00:00
parent 342c7ed457
commit d7874686a1
2 changed files with 140 additions and 0 deletions
+30
View File
@@ -2145,3 +2145,33 @@ Validation:
Follow-ups:
- Optional next bounded risk-reduction slice: assess whether any remaining non-service utility modules still use promise-chain axios extraction patterns and migrate them to shared clients where behavior contracts remain unchanged.
---
### CL-061: TASK22260 next slice — core token regression coverage addition (bounded hardening)
date: 2026-03-25
author: Cline
scope: `tests/phase22/core-token-behaviour.test.cjs`
type: change
rationale: Follow the previous core token migration with a bounded verification slice to lock the request-client contract and prevent regression to direct axios extraction patterns.
impact: Improves confidence in `actions/core/token.js` behavior (success + failure semantics) without runtime code changes.
status: completed
Summary:
- Added new focused Phase 22 behavioural test suite:
- `tests/phase22/core-token-behaviour.test.cjs`
- Coverage asserts:
- `getToken` success path returns token payload and calls `requestJson` with expected URL/method/body/headers
- failure path logs via `consoleLogger` and returns the original error object
- Test harness uses VM import stripping consistent with existing phase behavioural suites.
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 this phase22 suite to any aggregate test runner used in CI if/when phase-level suites are centrally orchestrated.