DEV Community

Discussion on: How to write tests for Prisma with Docker and Jest

Collapse
 
vkostunica profile image
vkostunica

Its confusing that in all docker-compose commands you never start database container, so its difficult to understand context of commands needed to start server and database containers, wait for 3306 port, run tests, and remove containers along with orphans and volumes.

I expected to see something like this:

docker-compose -f docker-compose.test.yml run --rm database && \
docker-compose -f docker-compose.test.yml run --rm server ./scripts/wait-for-it.sh database:3306 -- yarn jest -i
Enter fullscreen mode Exit fullscreen mode