claude-code-best/packages
unraid 8cd0e90ca6 test: add spread+flag axios mock helper to stop CI mock pollution
Bare `mock.module('axios', () => ({ default: { stubs } }))` is
process-global last-write-wins and drops `axios.create`, `request`,
`isAxiosError`, etc. that real consumers need. In CI's alphabetical
file order, that produces dozens of polluted failures (AgentsPlatformView,
schedule API, memory-stores API, etc.) that don't reproduce on WSL2.

Introduce `tests/mocks/axios.ts` with `setupAxiosMock()` — `require('axios')`
inside the factory, spread real shape, route each verb through a per-suite
`useStubs` flag. beforeAll flips on, afterAll flips off; the spread
fall-through eliminates cross-file leakage.

Refactored 12 axios mockers in tests/, plus the bare `@anthropic/ink` mocks
in ultrareviewCommand and onboarding suites (same pollution pattern broke
AgentsPlatformView's Box/Text rendering).

Verified: 5339/5345 tests pass locally; remaining 6 failures are
pre-existing isolation issues unrelated to this change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:55:58 +08:00
..
@ant feat: 尝试改进 Error 处理以提升内存管理效率 2026-05-05 18:18:13 +08:00
acp-link style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
agent-tools style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
audio-capture-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
builtin-tools test: add spread+flag axios mock helper to stop CI mock pollution 2026-05-09 15:55:58 +08:00
color-diff-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
image-processor-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
mcp-client fix: 优化内存峰值与 CPU 性能,降低 100-300MB 内存占用 2026-05-02 00:45:03 +08:00
modifiers-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
remote-control-server style: 添加 biome-ignore 消除 noUnusedPrivateClassMembers 警告 2026-05-01 22:01:54 +08:00
url-handler-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
weixin style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
tsconfig.json feat: 重构供应商层次 (#286) 2026-04-17 09:33:14 +08:00