#15569: test: comprehensive test coverage expansion (57 new test files)
channel: discord
channel: slack
channel: telegram
channel: whatsapp-web
gateway
channel: feishu
stale
size: XL
Cluster:
Test Coverage Enhancements
## Summary
Adds 57 new test files covering modules that previously had little or no test coverage. **All tests are pure additions — zero source file changes.**
### Modules covered
| Area | Test files |
|------|-----------|
| auto-reply | block-reply coalescer, config values, directives, inbound dedup/sender-meta/text, reply payloads, templating |
| channels | allowlist matching, resolve utils, media limits, feishu normalization, sender labels |
| config | agent limits, group policy, markdown tables, merge-patch, port defaults, version comparison, workspace schemas |
| gateway | device auth, HTTP utils |
| infra | backoff, bonjour errors, canvas host URL, errors, exec safety, format duration, heartbeat events, outbound adapters/directory cache, ports format, provider usage, WebSocket |
| misc | link understanding, logging levels, markdown parsing, media constants, memory status, Slack token, Telegram updates/captions, terminal ANSI/note, TUI fuzzy filter, utils (directive tags, queue helpers, shell argv, time format), web vcard |
## Test plan
- [ ] All 57 test files pass with \`vitest\`
- [ ] No source files modified — zero risk of behavioral regression
Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds 57 comprehensive test files covering previously untested modules across auto-reply, channels, config, gateway, infra, and utility functions. Tests demonstrate solid engineering practices with clear naming, good edge case coverage, and appropriate use of Vitest features.
**Key strengths:**
- Pure test additions with zero source code modifications, eliminating regression risk
- Well-structured tests following consistent patterns (descriptive names, comprehensive edge cases)
- Proper use of Vitest utilities including mocking (`vi.useFakeTimers`), type assertions, and structured test suites
- Tests cover important security-critical code like `exec-safety.ts` and configuration parsing
**Critical issue:**
- `src/config/workspace-schemas.test.ts` references non-existent data files (`workspace/data/narrative-variants.json` and `workspace/data/warroom_dashboard_config.json`), which will cause test failures
<h3>Confidence Score: 3/5</h3>
- Safe to merge after fixing the workspace-schemas test file issue
- Score reflects the high quality of test additions (pure additions with no source changes, comprehensive coverage, good patterns) but reduced due to one test file that will definitively fail because it references non-existent data files. After fixing that single test file, this would be a 5/5.
- src/config/workspace-schemas.test.ts requires immediate attention - references non-existent workspace data files
<sub>Last reviewed commit: a786e14</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#12684: Test: add missing unit tests for src/utils modules
by shaynhornik · 2026-02-09
83.9%
#9333: Tests: add test coverage for security/audit-fs.ts
by M00N7682 · 2026-02-05
82.8%
#20496: test(utils): add comprehensive unit tests for utility functions
by masifislamm · 2026-02-19
81.6%
#8964: test(msteams): add comprehensive tests for graph-upload module
by RajdeepKushwaha5 · 2026-02-04
79.7%
#11421: Tests: add unit tests for infra/format-duration
by PythonUser42 · 2026-02-07
78.9%
#4137: [AI-assisted] test(cli): add missing test cases for parseDurationMs
by sind00 · 2026-01-29
78.8%
#4095: Test/add format duration tests
by TechWizard9999 · 2026-01-29
78.5%
#12876: major test workflow: enhance coverage infrastructure
by Mathbkj · 2026-02-09
77.8%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
77.6%
#19095: test(discord): add unit tests for presence cache module
by Clawborn · 2026-02-17
76.4%