Skip to content

Commit ba4a899

Browse files
authored
Merge pull request #21 from fulll/refactor/dry-api-pagination-retry
Document api-utils.ts in AGENTS.md project layout and testing notes
2 parents b06d9bb + 9640ba3 commit ba4a899

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ src/
6969
# TextMatch, CodeMatch, RepoGroup, Row, TeamSection,
7070
# OutputFormat, OutputType)
7171
api.ts # GitHub REST API client (search, team fetching)
72+
api-utils.ts # Shared retry (fetchWithRetry) and pagination (paginatedFetch)
73+
# helpers used exclusively by api.ts — performs network I/O
7274
aggregate.ts # Result grouping & filtering (applyFiltersAndExclusions)
7375
group.ts # groupByTeamPrefix — team-prefix grouping logic
7476
render.ts # Façade re-exporting sub-modules + top-level
@@ -102,6 +104,7 @@ src/
102104
- Test files are named `<module>.test.ts` and sit next to their source file.
103105
- Use `describe` / `it` / `expect` from Bun's test runner.
104106
- Only pure functions need tests; `tui.ts` and `api.ts` are not unit-tested.
107+
`api-utils.ts` is the exception: its helpers are unit-tested by mocking `globalThis.fetch`.
105108
- When adding a function to an existing module, add the corresponding test case in the existing `<module>.test.ts`.
106109
- When creating a new module that contains pure functions, create a companion `<module>.test.ts`.
107110
- Tests must be self-contained: no network calls, no filesystem side effects.

0 commit comments

Comments
 (0)