The e2e suite ran against the development database and nothing truncated it. Every run seeded more fixtures and left them, so the unfiltered storefront grew monotonically — 1,662 items by the time #186 was filed — until rendering it outran the assertions' timeouts. It failed locally, passed in CI where the database is fresh, and got steadily worse, which is the combination nobody can act on. start-local.ps1 -E2eDb runs the stack against a separate container on a separate port with tmpfs storage, so it starts empty every time. Migrations already run on every start, so an empty volume is a working one. The development database is untouched, so anything set up there by hand survives. Deliberately a third database rather than sharing either existing one. The integration suite truncates between tests, so an e2e run sharing with it would have its fixtures deleted underneath it (#116) — different container, different port, different credentials, so the mistake is impossible rather than discouraged. Verified by recreating the database from the compose file, confirming it came up with zero items, and running the full suite against it: 157 of 157. An earlier attempt at this reported 23 passed and 53 not run, which was worthless — a stale backend from a previous run still held port 3000 and was talking to a database I had already deleted. The port is checked before the run now, and the same mistake produced a wrong rate-limiter measurement earlier in this work. Pagination is the other half of #186 and is filed separately: a shop that renders its whole catalogue in one page is worth fixing on its own merits, not as a side effect of a test fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
72 lines
2.5 KiB
JSON
Executable File
72 lines
2.5 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",
|
|
"lint": "eslint src scripts",
|
|
"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"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/sdk": "^0.122.0",
|
|
"@types/markdown-it": "^14.2.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"cookie-parser": "^1.4.6",
|
|
"drizzle-orm": "^0.45.2",
|
|
"express": "^4.19.2",
|
|
"express-rate-limit": "^8.6.2",
|
|
"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",
|
|
"drizzle-kit": "^0.31.10",
|
|
"eslint": "^9.39.5",
|
|
"eslint-plugin-sonarjs": "^4.2.0",
|
|
"globals": "^17.11.0",
|
|
"jest": "^29.7.0",
|
|
"supertest": "^7.0.0",
|
|
"ts-jest": "^29.2.4",
|
|
"tsx": "^4.16.5",
|
|
"typescript": "^5.5.4",
|
|
"typescript-eslint": "^8.67.0"
|
|
}
|
|
}
|