@@ -272,10 +272,15 @@ setup-testdb:
272272 cd " {{ backend_dir }} "
273273 DATABASE_URL=" {{ testdb_url }} " PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma migrate dev
274274
275- test target * args :
275+ test target = " all" * args :
276276 #!/usr/bin/env bash
277277 set -euox pipefail
278278 case " {{ target }} " in
279+ all)
280+ just test backend
281+ just test e2e
282+ just test e2e-ui
283+ ;;
279284 backend)
280285 echo " NodeJS:" $(node -v)
281286 echo " Prisma Engine:" {{ prisma_engine }}
@@ -284,38 +289,40 @@ test target *args:
284289 cd " {{ backend_dir }} "
285290 DATABASE_URL=" postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS=" --max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --runInBand --logHeapUsage --no-compilation-cache --silent=false {{ args }}
286291 ;;
287- esac
288-
289- test-e2e * args :
290- #!/usr/bin/env bash
291- set -euox pipefail
292- echo " NodeJS:" $(node -v)
293- echo " Prisma Engine:" {{ prisma_engine }}
294-
295- just setup-testdb
296- cd " {{ backend_dir }} "
297- DATABASE_URL=" postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS=" --max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --config ./ jest-e2e.json --runInBand --no-compilation-cache --forceExit {{ args }}
292+ e2e)
293+ echo " NodeJS:" $(node -v)
294+ echo " Prisma Engine:" {{ prisma_engine }}
298295
299- test-e2e-ui mode = " ":
300- #!/usr/bin/env bash
301- set -euo pipefail
302- if [ " {{ mode }} " = " report" ]; then
303- if [ ! -f " playwright-report/index.html" ]; then
304- echo " No report found. Run tests first: just test-e2e-ui"
296+ just setup-testdb
297+ cd " {{ backend_dir }} "
298+ DATABASE_URL=" postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS=" --max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --config ./ jest-e2e.json --runInBand --no-compilation-cache --forceExit {{ args }}
299+ ;;
300+ e2e-ui)
301+ set + x
302+ if [ " {{ args }} " = " report" ]; then
303+ if [ ! -f " playwright-report/index.html" ]; then
304+ echo " No report found. Run tests first: just test e2e-ui"
305+ exit 1
306+ fi
307+ pnpm test:e2e-ui:report
308+ else
309+ set -x
310+ # Kill any existing backend processes and wait for termination
311+ pkill -f " nest start" || true
312+ while pgrep -f " nest start" > / dev/ null; do sleep 0.5 ; done
313+
314+ just setup-testdb
315+ cd " {{ backend_dir }} "
316+ DATABASE_URL=" postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma db seed
317+ cd " {{ root_dir }} "
318+ pnpm test:e2e-ui
319+ fi
320+ ;;
321+ *)
322+ echo " Unknown target: {{ target }} "
305323 exit 1
306- fi
307- pnpm test:e2e-ui:report
308- else
309- # Kill any existing backend processes and wait for termination
310- pkill -f " nest start" || true
311- while pgrep -f " nest start" > / dev/ null; do sleep 0.5 ; done
312-
313- just setup-testdb
314- cd " {{ backend_dir }} "
315- DATABASE_URL=" postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma db seed
316- cd " {{ root_dir }} "
317- pnpm test:e2e-ui
318- fi
324+ ;;
325+ esac
319326
320327run-backend-prod :
321328 ./ scripts/ run-backend-prod.sh
0 commit comments