Coexists with Mocha (kept for unit-style tests) and Cypress (unchanged, web e2e). Adds: - apps/api/features/*.feature — Gherkin scenarios - apps/api/features/step-definitions/*.steps.ts — step implementations - apps/api/features/support/world.ts — per-scenario World, spins up the Express app in-process via createApp() + supertest (no real server needed, same approach as the existing Mocha health test) - apps/api/cucumber.cjs — config, deliberately .cjs (not .js) to avoid the same ESM/CJS config-loading mismatch that broke apps/web/cypress.config.ts earlier - `test:bdd` script (cross-env + tsx via NODE_OPTIONS=--import=tsx, for cross-platform ESM+TS loading) - health.feature/steps as a working example, mirroring the existing Mocha health test so both suites cover the same behavior in their respective styles CI: runs `pnpm --filter api test:bdd` alongside the existing test step. README: documents the new test layer and the TS/ESM config-loading caveat for future tool configs. Verified locally: lint, mocha, cucumber, and full build all pass.
34 lines
853 B
JSON
34 lines
853 B
JSON
{
|
|
"name": "api",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "tsx watch src/server.ts",
|
|
"build": "tsc -p tsconfig.json",
|
|
"start": "node dist/server.js",
|
|
"test": "mocha",
|
|
"test:bdd": "cross-env NODE_OPTIONS=--import=tsx cucumber-js",
|
|
"prisma:generate": "prisma generate",
|
|
"prisma:migrate": "prisma migrate dev"
|
|
},
|
|
"dependencies": {
|
|
"@prisma/client": "^5.22.0",
|
|
"dotenv": "^16.4.5",
|
|
"express": "^4.21.1",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"devDependencies": {
|
|
"@cucumber/cucumber": "^13.2.1",
|
|
"@types/express": "^4.17.21",
|
|
"@types/node": "^22.9.0",
|
|
"@types/supertest": "^6.0.2",
|
|
"chai": "^5.1.2",
|
|
"cross-env": "^10.1.0",
|
|
"mocha": "^10.8.2",
|
|
"prisma": "^5.22.0",
|
|
"supertest": "^7.0.0",
|
|
"tsx": "^4.19.2",
|
|
"typescript": "^5.7.2"
|
|
}
|
|
}
|