Skip to content

Commit

Permalink
docs: Add info about testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuv2707 committed May 31, 2024
1 parent 44cb553 commit 61e81e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Given that you have already forked the repository and set it up locally:
- Make the necessary changes to fix the issue. Follow the existing code style and conventions. Please refer to the code style and conventions in [CONVENTIONS.md](CONVENTIONS.md).

7. **Test Your Changes**:
- Thoroughly test your changes to ensure they work as intended and do not introduce any new bugs.
- Thoroughly test your changes manually to ensure they work as intended and do not introduce any new bugs.
- You can write unit tests for backend changes whenever required. Your changes should not cause existing tests to fail.
- Adhere to the eslint suggestions and use prettier to format code before committing.
Running `npm run fix-format` in both the frontend and the backend will format all the files using prettier.

Expand Down
9 changes: 9 additions & 0 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@
- Try to keep the use of external dependencies to a minimum. This is because the purpose of project is first to learn and then to build. So, we will try to build as much as possible from scratch. That way there are more issues to work on.
Remember to review and adhere to these conventions to maintain a clean and consistent codebase.
## Testing
We use `jest` for backend tests. You can run the tests using the following command:
```bash
cd backend
npm run test
```

For testing a function using `jest`, you have to export it from the module.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ This project is a multiplayer UNO game built using the MERN (MongoDB, Express, R
- **Node.js**: To run the server-side code and manage dependencies.
- **Socket.IO**: For real-time communication between players in the game rooms.

Additionally, we use `jest` for backend tests.

0 comments on commit 61e81e7

Please sign in to comment.