Add unit and integration test suites

- Shared: link building, feed ordering, input schemas, API client
- API unit: track matching, private-address blocking, token crypto,
  plan expiry, provider response parsing
- API integration against Postgres and Redis: auth, follows and pins,
  now-playing state, webhooks, OAuth return URLs, realtime, rate limits
- Tests use a dedicated *_test database and Redis DB, and refuse to wipe
  anything else; fetch is stubbed so they never hit the network
- Pin Node to 22.13+ (.nvmrc), which Vite's native bindings require

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
This commit is contained in:
2026-10-03 11:28:17 -04:00
co-authored by Claude Opus 5.5
parent 95cd740e51
commit fe503307df
29 changed files with 3281 additions and 10 deletions
+8 -4
View File
@@ -10,13 +10,17 @@
"start:worker": "node dist/worker.js",
"typecheck": "tsc -p .",
"db:generate": "drizzle-kit generate",
"db:migrate": "tsx src/db/migrate.ts"
"db:migrate": "tsx src/db/migrate.ts",
"test": "vitest run",
"test:unit": "vitest run --project unit",
"test:watch": "vitest"
},
"dependencies": {
"@fastify/cookie": "^11.1.2",
"@fastify/cors": "^11.3.0",
"@fastify/rate-limit": "^11.2.0",
"@fastify/websocket": "^11.3.2",
"@musicshare/shared": "*",
"@node-rs/argon2": "^2.2.1",
"bullmq": "^6.3.11",
"dotenv": "^18.0.5",
@@ -25,8 +29,7 @@
"ioredis": "^6.0.0",
"postgres": "^3.4.9",
"undici": "^6.29.0",
"zod": "^4.6.5",
"@musicshare/shared": "*"
"zod": "^4.6.5"
},
"devDependencies": {
"@types/node": "^26.6.4",
@@ -35,6 +38,7 @@
"drizzle-kit": "^0.31.11",
"tsup": "^8.5.1",
"tsx": "^4.23.15",
"typescript": "~6.0.3"
"typescript": "~6.0.3",
"vitest": "^5.0.3"
}
}