starbasedb
starbasedb copied to clipboard
test: cover stats plugin
/claim #71
Summary
- add focused Vitest coverage for the Stats plugin
- cover plugin metadata, non-admin rejection, admin stats responses, current plugin list inclusion, missing data source behavior, and per-request middleware refresh of config/dataSource
- use a Hono test app and mocked data source/registry methods so the route behavior is exercised without external services
Verification
COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec prettier --check plugins/stats/index.test.tsCOREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm vitest plugins/stats/index.test.ts --rungit diff --checkCOREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec tsc --noEmit --pretty falsestill reports existing repository errors inplugins/cdc,src/cache,src/do, andsrc/operation; no errors mentionplugins/statsCOREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm vitest --runstill reports the existing 4 RLS failures insrc/rls/index.test.ts; the new Stats test file passes in the full run
Notes
This is a non-overlapping coverage slice for #71, separate from the Stripe, WebSocket, Clerk, CDC, SQL macros, and Resend plugin PRs I submitted earlier.