Skip to content

test(coverage): add unit tests for agent-profiles context fetching and hintConfig trailing messages#537

Merged
zbigniewsobiecki merged 1 commit intodevfrom
test/coverage-agent-profiles-hintconfig
Feb 24, 2026
Merged

test(coverage): add unit tests for agent-profiles context fetching and hintConfig trailing messages#537
zbigniewsobiecki merged 1 commit intodevfrom
test/coverage-agent-profiles-hintconfig

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Feb 24, 2026

Summary

  • Adds comprehensive unit tests for src/backends/agent-profiles.ts context-fetching functions, covering all 4 orchestration paths (fetchWorkItemContext, fetchReviewContext, fetchCIContext, fetchPRCommentResponseContext) and their helper functions (fetchDirectoryListing, fetchContextFileInjections, fetchSquintOverview, fetchWorkItemInjection)
  • Adds new tests for src/config/hintConfig.ts covering the implementation agent trailing message builder, formatIterationStatus urgency levels (no emoji / ⚠️ / 🚨), and formatDiagnosticLoopWarning threshold behavior
  • Extends the existing agent-profiles.test.ts mock setup with readPRFileContents, resolveSquintDbPath, and execFileSync mocks needed for context tests
  • Total: 57 tests in agent-profiles.test.ts (+29 new context tests) and 29 tests in hintConfig.test.ts (+18 new tests) — 86 tests in these two files

Test plan

  • npm test — all 3139 tests pass (184 files)
  • npm run lint:fix — no errors (1 pre-existing warning in unrelated file)
  • npm run typecheck — zero errors

Card

https://trello.com/c/79qkpRR2/109-find-top-area-that-needs-test-coverage-and-plan-new-tests

🤖 Generated with Claude Code

@nhopeatall
Copy link
Copy Markdown
Collaborator

nhopeatall commented Feb 24, 2026

🤖 On it — checking the PR now


Progress: [██░░░░░░░░] 21% (iteration 15/70)

🔍 Code Review Update (1 min)
I've completed an initial review of the PR, focusing on the new unit tests for agent-profiles.ts and hintConfig.ts. I've examined the source files and the tests themselves, noting that params.input is accessed correctly. I'm currently analyzing the test quality and have identified a minor issue with an unused beforeEach import in hintConfig.test.ts.

Last updated: iteration 15 · review

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Well-structured test additions covering context-fetching orchestration paths in agent-profiles.ts and trailing message logic in hintConfig.ts. Tests correctly exercise happy paths, error handling (squint failures, work item errors), and edge cases (empty outputs, missing cardId). Mock isolation is proper with the top-level beforeEach clearing all mocks between tests. CI is green.

@zbigniewsobiecki zbigniewsobiecki merged commit 1335bb3 into dev Feb 24, 2026
5 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the test/coverage-agent-profiles-hintconfig branch February 24, 2026 16:55
@zbigniewsobiecki zbigniewsobiecki mentioned this pull request Feb 25, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants