#22990: test: fix readonly typing regressions in CI check baseline
channel: discord
channel: telegram
commands
size: S
## Summary
- fix TypeScript readonly inference regressions in tests that currently fail `pnpm check`
- keep scope to test typing/fixtures only (no runtime behavior changes)
- unblock stacked security PRs that are currently red due baseline `check` failures
## Why
`CI/check` currently fails with readonly/type narrowing errors in test fixtures across multiple modules. This prerequisite isolates the baseline fixes so security PRs can remain scoped.
## Validation
- CI only (no local test execution in this session)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixed TypeScript readonly type inference regressions across test fixtures. The changes address strict typing violations where readonly arrays/objects from `as const` test fixtures were being passed to functions expecting mutable parameters. All modifications use defensive copies via spread operators (`[...]`, `{...}`) to preserve test isolation while satisfying type constraints.
- Added missing `expectBodyContents` field to test fixtures
- Created mutable copies of readonly arrays using spread syntax
- Fixed type assertion chain in `redact-snapshot.test.ts` to properly narrow nested object types
- Added explicit generic type parameters to empty `Set<string>()` constructors
- Added missing `configured` field to mock return value to match actual function signature
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- All changes are test-only typing fixes with no runtime behavior modifications. The fixes correctly address readonly/mutable type mismatches using standard defensive copy patterns, and one mock was corrected to include a required field that matches the actual function signature.
- No files require special attention
<sub>Last reviewed commit: 0a71b3a</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21027: fix(tests): resolve TypeScript type errors in CLI test files
by kittipond2365 · 2026-02-19
77.9%
#23772: fix(ci): unblock repo-wide check gate type regressions
by SmithLabsLLC · 2026-02-22
77.3%
#17393: fix(ci): resolve TS2742 type error blocking all PRs
by miloudbelarebia · 2026-02-15
75.6%
#22442: test(ci): unbreak baseline tui metadata + msteams local-file assert...
by SmithLabsLLC · 2026-02-21
75.0%
#23594: test(tui): fix mock typing in command handler tests
by Sashamine · 2026-02-22
74.2%
#23139: test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present
by Imccccc · 2026-02-22
73.5%
#16658: test: isolate env-dependent gateway/auth fixtures
by sauerdaniel · 2026-02-15
72.6%
#22178: test(web): allow fixture roots in media local file tests
by Kansodata · 2026-02-20
72.5%
#23072: test(nodes-camera): guard optional response in invalid-url cases
by NewdlDewdl · 2026-02-22
72.0%
#7085: test: skip flaky workspace-paths & safe-bins tests on non-Linux/CI ...
by ThinkIbrokeIt · 2026-02-02
71.5%