https://github.com/pmarkaide/42_transcendence
https://github.com/pmarkaide/42_transcendence
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmarkaide/42_transcendence
- Owner: pmarkaide
- Created: 2025-03-25T12:34:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-27T10:08:11.000Z (about 1 year ago)
- Last Synced: 2025-03-27T11:24:23.440Z (about 1 year ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 42_transcendence
Run the docker compose
```
docker-compose up --build
```
OR run manually:
create database
`cd SQLite`
`docker build -t db .`
`docker run -d --name sqlite -v $(pwd)/data:/data db`
to run backend:
`cd backend`
`npm install fastify`
`npm install -D nodemon`
`npm install sqlite3`
`npm install @fastify/swagger @fastify/swagger-ui`
`npm run dev`
to create test users:
`cd SQLite`
`sh create_users.sh`
if you go to localhost:8888/documentation you can see the API endpoints instead
---
## Unit tests
The backend uses TAP for testing. TAP will automatically run every file with "test" in its name as well as everything inside the test directory.
### Running Unit Tests
To run all the unit tests, execute:
`docker-compose run --rm backend npm test`
### Viewing Full Coverage Report
If you want to see a detailed coverage report, run:
`docker-compose run --rm backend npm test -- --show-full-coverage`
### Allowing Incomplete coverage
By default, TAP may return a non-zero exit code if code coverage is not 100%. To allow incomplete coverage and avoid failing the build, use:
`docker-compose run --rm backend npm test -- --allow-incomplete-coverage`
`Note: The docker-compose command may be system specific. Adjust the command accordingly if your setup differs.`