The trigger added in #322 does not typecheck. pg declares query with several overloads and jest.spyOn resolves the mock argument against the last of them, whose parameter list is empty, so the inferred type of a rejection value is never and an Error cannot be assigned to it. ts-jest compiles each suite as it runs, so this surfaced as a suite that failed to run rather than as a test that failed — which is why CI reported 446 tests passing, zero failing, and the step red anyway. The cast is the type system rather than a shortcut, and says so in the file: every overload rejects on failure, and the cast only chooses which one to check against. The reason this reached main is the part worth keeping. The backend has a tsconfig.test.json covering scripts and tests, and nothing was running it — build compiles src alone, and I had been reporting tsc clean on that basis while touching test files it never looked at. The frontend build has run its equivalent all along, so the gap was one workspace wide and invisible from the other. It is now a script, typecheck:tests, and it reproduces this failure in seconds against no database. That matters beyond this fix: the standing excuse for integration regressions here has been that the suite needs Postgres and a Node this machine cannot run, and a type error in a test was never actually in that category — it only looked like it because the check that finds it was never invoked. Not added to build. The Dockerfile runs that, and a production image should not fail to build because a test file has a type error. Verified: typecheck:tests clean, build tsc clean, lint 0 errors with no new warnings, 485 unit tests passing. The suite itself still needs CI to run. Refs #307 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
74 lines
2.7 KiB
JSON
Executable File
74 lines
2.7 KiB
JSON
Executable File
{
|
|
"name": "redefined-designs-backend",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"main": "dist/server.js",
|
|
"engines": {
|
|
"node": ">=20.9.0"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"typecheck:tests": "tsc -p tsconfig.test.json --noEmit",
|
|
"lint": "eslint src scripts tests",
|
|
"start": "node dist/server.js",
|
|
"dev": "tsx watch src/server.ts",
|
|
"test": "npm run test:unit",
|
|
"test:unit": "jest -c jest.unit.config.js",
|
|
"test:unit:json": "jest -c jest.unit.config.js --json --outputFile=unit-results.json",
|
|
"test:unit:cov": "jest -c jest.unit.config.js --coverage",
|
|
"test:integration": "jest -c jest.integration.config.js --runInBand",
|
|
"test:integration:json": "jest -c jest.integration.config.js --runInBand --json --outputFile=integration-results.json",
|
|
"test:integration:cov": "jest -c jest.integration.config.js --runInBand --coverage --forceExit",
|
|
"bench:hashing": "tsx scripts/bench-hash-latency.ts",
|
|
"backfill:images": "node dist/backfillImageReencode.js",
|
|
"db:e2e:up": "docker compose -f docker-compose.e2e.yml up -d",
|
|
"db:e2e:down": "docker compose -f docker-compose.e2e.yml down",
|
|
"db:test:up": "docker compose -f docker-compose.test.yml up -d",
|
|
"db:test:down": "docker compose -f docker-compose.test.yml down -v",
|
|
"migrate:up": "node migrate.js up",
|
|
"migrate:down": "node migrate.js down",
|
|
"migrate:create": "node-pg-migrate create --migration-file-language js",
|
|
"db:types": "kysely-codegen --dialect postgres --exclude-pattern pgmigrations --url \"env(KYSELY_DATABASE_URL)\" --out-file src/db-kysely/schema.ts"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/sdk": "^0.122.0",
|
|
"@types/markdown-it": "^14.2.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"cookie-parser": "^1.4.6",
|
|
"express": "^4.19.2",
|
|
"express-rate-limit": "^8.6.2",
|
|
"kysely": "^0.28.17",
|
|
"markdown-it": "^15.0.0",
|
|
"multer": "^1.4.5-lts.1",
|
|
"node-cron": "^3.0.3",
|
|
"node-pg-migrate": "^7.6.1",
|
|
"nodemailer": "^6.9.14",
|
|
"pg": "^8.12.0",
|
|
"sharp": "^0.35.4",
|
|
"zod": "^4.5.4"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.5",
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/cookie-parser": "^1.4.7",
|
|
"@types/express": "^4.17.21",
|
|
"@types/jest": "^29.5.12",
|
|
"@types/multer": "^1.4.11",
|
|
"@types/node": "^20.14.15",
|
|
"@types/node-cron": "^3.0.11",
|
|
"@types/nodemailer": "^6.4.15",
|
|
"@types/pg": "^8.11.6",
|
|
"@types/supertest": "^6.0.2",
|
|
"eslint": "^9.39.5",
|
|
"eslint-plugin-sonarjs": "^4.2.0",
|
|
"globals": "^17.11.0",
|
|
"jest": "^29.7.0",
|
|
"kysely-codegen": "^0.20.0",
|
|
"supertest": "^7.0.0",
|
|
"ts-jest": "^29.2.4",
|
|
"tsx": "^4.16.5",
|
|
"typescript": "^5.5.4",
|
|
"typescript-eslint": "^8.67.0"
|
|
}
|
|
}
|