test(core): add bounded regression coverage for token request client
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user