Skip to main content

How to Run Integration Tests Locally

1. Add the Integration Test Tag to the Project

The easiest way is to use the docker-compose.ci.yaml file to run the integration tests locally. This file is used by the test runner to run the integration tests.

docker compose -f docker-compose.ci.yaml run --rm --name test-runner \
-v $(pwd)/apps/ITEM-API/cerbos:/etc/cerbos/policies \
-v "$(pwd)/apps:/app/apps" \
-v "$(pwd)/libs:/app/libs" \
-e "NEST_APP=ITEM-API" \
node pnpm nx run ITEM-API:test -i --ci --forceExit

There is also a helper script to make this less verbose:

./bin/test <app-name> [options]

./bin/test item-api --watchAll