Before spinning up this project, make sure no other program is running on port 3000 on the host machine.
To run this project:
-
clone the repo
-
go to the root directory (where docker-compose.yml is located)
-
depending on your docker installation, run:
docker compose up --build
ordocker-compose up --build
-
go to
localhost:3000
on your host machine to play the game
There are three types of tests implemented
to run unit tests:
-
go into the frontend container
docker exec -it poker_frontend sh
-
run the tests
npx jest
to run api tests:
-
go into the backend container
docker exec -it poker_backend sh
-
run the tests
poetry run pytest
Running e2e tests from within the docker container requires headless browsers to be installed inside the container, bloating the container and lengthening the build time. Thus the frontend's Dockerfile in the main branch does not install these components. For this reason, e2e tests can be run only after switching the branch to 'e2e_test_enabled'.
To run e2e tests:
-
switch branch
git switch e2e_test_enabled
-
spin up the project
docker compose up --build
-
get into the frontend container
docker exec -it poker_frontend sh
-
run tests
npx playwright test