## Summary - Replace Redis command fakes with `ioredis-mock` in API tests. - Run the production Lua scripts through `EVAL`. - Keep Redis behavior tests on the same command and Pub/Sub implementation used by production code. ## Stack - This PR is the base for #2289. - It replaces #2291 as the merge-to-`main` unit. #2291 merged into the old ConfigKV branch before the stack could be reordered. ## Tests - `pnpm install --frozen-lockfile --offline --ignore-scripts` - `pnpm exec vitest run <6 changed API test files>` (73 tests passed) - `pnpm exec eslint <7 changed API TypeScript files>` - `git diff --check` ## Visual changes None. This PR changes test infrastructure only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added isolated in-memory Redis support for automated testing. * Updated billing, Stripe, flux, concurrency, and user-deletion tests to use a shared Redis test setup. * Improved verification of Redis operations while preserving existing test coverage and expected outcomes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: RainbowBird <rbxin2003@outlook.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
76 lines
2.6 KiB
JSON
76 lines
2.6 KiB
JSON
{
|
|
"name": "@proj-airi/api-server",
|
|
"type": "module",
|
|
"version": "0.11.3",
|
|
"private": true,
|
|
"exports": {
|
|
"./app-type": "./src/app-type.ts"
|
|
},
|
|
"scripts": {
|
|
"apply:env": "dotenvx run -f .env.local --overload --ignore=MISSING_ENV_FILE",
|
|
"dev": "pnpm run apply:env -- tsx --import ./instrumentation.ts --watch src/main.ts",
|
|
"start": "pnpm run apply:env -- tsx --import ./instrumentation.ts src/main.ts",
|
|
"build": "tsc -b",
|
|
"typecheck": "tsc --noEmit",
|
|
"db:generate": "drizzle-kit generate",
|
|
"db:push": "pnpm run apply:env -- drizzle-kit push"
|
|
},
|
|
"dependencies": {
|
|
"@dotenvx/dotenvx": "catalog:",
|
|
"@electric-sql/pglite": "catalog:",
|
|
"@guiiai/logg": "catalog:",
|
|
"@hono/node-server": "catalog:",
|
|
"@hono/node-ws": "catalog:",
|
|
"@hono/otel": "catalog:",
|
|
"@langfuse/otel": "catalog:",
|
|
"@langfuse/tracing": "catalog:",
|
|
"@moeru/eventa": "catalog:",
|
|
"@moeru/std": "catalog:",
|
|
"@opentelemetry/api": "catalog:",
|
|
"@opentelemetry/api-logs": "catalog:",
|
|
"@opentelemetry/exporter-logs-otlp-proto": "catalog:",
|
|
"@opentelemetry/exporter-metrics-otlp-proto": "catalog:",
|
|
"@opentelemetry/exporter-trace-otlp-proto": "catalog:",
|
|
"@opentelemetry/instrumentation": "catalog:",
|
|
"@opentelemetry/instrumentation-http": "catalog:",
|
|
"@opentelemetry/instrumentation-ioredis": "catalog:",
|
|
"@opentelemetry/instrumentation-pg": "catalog:",
|
|
"@opentelemetry/instrumentation-runtime-node": "catalog:",
|
|
"@opentelemetry/instrumentation-undici": "catalog:",
|
|
"@opentelemetry/resources": "catalog:",
|
|
"@opentelemetry/sdk-logs": "catalog:",
|
|
"@opentelemetry/sdk-metrics": "catalog:",
|
|
"@opentelemetry/sdk-node": "catalog:",
|
|
"@opentelemetry/sdk-trace-node": "catalog:",
|
|
"@opentelemetry/semantic-conventions": "catalog:",
|
|
"@proj-airi/auth-shared": "workspace:*",
|
|
"@proj-airi/drizzle-migration": "workspace:*",
|
|
"@proj-airi/drizzle-orm-browser-migrator": "catalog:",
|
|
"@proj-airi/server-sdk-shared": "workspace:*",
|
|
"drizzle-orm": "catalog:",
|
|
"drizzle-valibot": "catalog:",
|
|
"es-toolkit": "catalog:",
|
|
"hono": "catalog:",
|
|
"hono-rate-limiter": "catalog:",
|
|
"injeca": "catalog:",
|
|
"ioredis": "catalog:",
|
|
"jose": "catalog:",
|
|
"nanoid": "catalog:",
|
|
"ofetch": "catalog:",
|
|
"pg": "catalog:",
|
|
"posthog-node": "catalog:",
|
|
"stripe": "catalog:",
|
|
"unspeech": "catalog:xsai",
|
|
"valibot": "catalog:",
|
|
"ws": "catalog:",
|
|
"zod": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@types/ioredis-mock": "catalog:",
|
|
"@types/pg": "catalog:",
|
|
"@types/ws": "catalog:",
|
|
"drizzle-kit": "catalog:",
|
|
"ioredis-mock": "catalog:"
|
|
}
|
|
}
|