Files
spotlightcam/Makefile
Radosław Gierwiało bfbfd0e729 test: fix auth test expectations and add test commands to Makefile
- Update auth.test.js to match current API error messages
  - Registration success message includes email verification notice
  - Duplicate credentials use generic message to prevent user enumeration

- Add test commands to Makefile
  - make test: run all backend tests
  - make test-watch: run tests in watch mode
  - make test-coverage: run tests with coverage report

All auth tests now pass (19/19 ✓)
2025-11-19 20:23:25 +01:00

69 lines
2.1 KiB
Makefile

SHELL := /bin/bash
COMPOSE ?= docker compose
PROFILE ?= dev
# Select backend service name based on profile
ifeq ($(PROFILE),prod)
BACKEND_SVC := backend-prod
else
BACKEND_SVC := backend
endif
.PHONY: help dev-cli prod-cli \
dev-up dev-down dev-up-rebuild \
prod-up prod-down prod-up-rebuild \
test test-watch test-coverage
help:
@echo "Available targets:"
@echo " make dev-cli # Start admin REPL in dev backend"
@echo " make prod-cli # Start admin REPL in prod backend"
@echo " make dev-up # docker compose --profile dev up"
@echo " make dev-up-rebuild # docker compose --profile dev up --build"
@echo " make dev-down # docker compose --profile dev down"
@echo " make prod-up # docker compose --profile prod up -d"
@echo " make prod-up-rebuild # docker compose --profile prod up -d --build"
@echo " make prod-down # docker compose --profile prod down"
@echo " make test # Run backend tests"
@echo " make test-watch # Run backend tests in watch mode"
@echo " make test-coverage # Run backend tests with coverage report"
@echo "Notes: GNU Make nie wspiera subkomend z odstępami (np. 'make prod up')."
@echo " Użyj odpowiednich celów z myślnikiem."
# Admin CLI explicit targets
dev-cli:
$(COMPOSE) exec backend npm run cli
prod-cli:
$(COMPOSE) exec backend-prod npm run cli
# Development profile
dev-up:
$(COMPOSE) --profile dev up -d
dev-up-rebuild:
$(COMPOSE) --profile dev up -d --build
dev-down:
$(COMPOSE) --profile dev down
# Production profile
prod-up:
$(COMPOSE) --profile prod up -d
prod-up-rebuild:
$(COMPOSE) --profile prod up -d --build
prod-down:
$(COMPOSE) --profile prod down
# Tests
test:
$(COMPOSE) exec $(BACKEND_SVC) npm test
test-watch:
$(COMPOSE) exec $(BACKEND_SVC) npm run test:watch
test-coverage:
$(COMPOSE) exec $(BACKEND_SVC) npm test -- --coverage