chore(quality): provider fixtures, formatter snapshots, platform contract tests, CI, CodeQL, dependabot

This commit is contained in:
RhenCloud 2026-08-15 17:30:51 +08:00
parent 04fa52db52
commit 320e825bf8
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
15 changed files with 405 additions and 3 deletions

View file

@ -75,8 +75,14 @@ server/ # Nitro server (H3 handlers in server/routes/)
└── locales/ # en.ts, zh.ts translation dictionaries
tests/ # Unit tests (bun test)
tests/fixtures/ # Provider payload fixtures (github/gitea/custom)
tests/__snapshots__/ # Formatter snapshot golden files
```
Continuous integration (`.github/workflows/ci.yml`) runs `bun install --frozen-lockfile`,
`bun test`, and `bun run lint`. CodeQL (`codeql.yml`) and Dependabot (`dependabot.yml`) are
configured under `.github/`.
## Scripts
| Command | Description |
@ -112,6 +118,12 @@ bun test
curl http://localhost:8787/health
```
Beyond the per-module unit tests, the suite includes provider fixtures
(`tests/fixtures/` + `tests/provider-fixtures.test.ts`), formatter snapshots
(`tests/formatter-snapshot.test.ts`), and platform contract tests
(`tests/platform-contract.test.ts`) that assert the Discord/Telegram renderers clamp to their
platform limits.
## Adding a New Event Formatter
1. Add the event type to `GITHUB_COLORS` in `server/lib/formatters/colors.ts` (if new color needed)