Skip to content

Commit 185ac0d

Browse files
committed
docs: add test coverage section to README and CLAUDE.md (64 tests)
1 parent 4921dd1 commit 185ac0d

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,17 @@ npm install # Install dependencies
4141
npm run dev # Development server
4242
npm run build # Production build
4343
npm run migrate # Run database migrations
44+
npm test # Run 64 unit tests (Vitest)
4445
```
4546

47+
## Test Coverage
48+
49+
64 tests across 10 files. Run with `npm test`.
50+
51+
Covered modules: `differ` (16), `feed-parser` (10), `schema` (10), `bluesky` (6), `auth` (5), `atom-builder` (4), `rate-limit` (4), `extractor` (3), `card-generator` (3), `websub` (3).
52+
53+
Not unit-tested (integration): `feed-poller`, `syndicator`, `bot/index.ts` — these require Redis/Postgres and are tested against the live deployment.
54+
4655
## Project Structure
4756

4857
```

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ npm test # Vitest unit tests
9595
npm run migrate # Run DB migrations
9696
```
9797

98+
### Test coverage
99+
100+
64 tests across 10 test files covering all core services:
101+
102+
| Module | Tests | What's covered |
103+
|--------|-------|----------------|
104+
| `differ` | 16 | Word-level diffing, boring detection (timestamps, relative times, date changes) |
105+
| `feed-parser` | 10 | RSS, Atom, JSON Feed parsing, hub discovery (WebSub) |
106+
| `bluesky` | 6 | Post construction, config check, character limits |
107+
| `auth` | 5 | Session cookies, HMAC signing, tampering, expiry, OIDC check |
108+
| `atom-builder` | 4 | XML generation, escaping, self links |
109+
| `rate-limit` | 4 | Allow/block/reset/key isolation |
110+
| `extractor` | 3 | Content extraction (Defuddle/Readability), feed-listing rejection |
111+
| `card-generator` | 3 | Diff card image generation, alt text |
112+
| `websub` | 3 | Subscription params, error handling |
113+
| `schema` | 10 | Database schema validation |
114+
115+
Workers (feed-poller, syndicator) and the AP bot require Redis/Postgres connections and are covered by integration testing against the live deployment.
116+
98117
## Architecture
99118

100119
```

0 commit comments

Comments
 (0)