Skip to content

Commit

Permalink
Update Contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aadhil2k4 committed Jan 14, 2025
1 parent 334f0f7 commit 3e1cf0a
Showing 1 changed file with 63 additions and 4 deletions.
67 changes: 63 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ If you are new to contributing to open source, please read the Open Source Guide
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [Jest Testing](#jest-testing)
- [Vitest Testing](#vitest-testing)
- [Internships](#internships)
- [Community](#community)

Expand Down Expand Up @@ -98,20 +100,37 @@ The process of proposing a change to Talawa Admin can be summarized as:
1. Pull requests that don't meet the minimum test coverage levels will not be accepted. This may mean that you will have to create tests for code you did not write. You can decide which part of the code base needs additional tests if this happens to you.

2. **_Testing_:**
#### Jest Testing

1. Test using this set of commands:
1. Running a single test:

```
npm run test path/to/test/file
```
2. Running all tests:
```
npm run test --watchAll=false
```
3. Viewing the code coverage of a single test file:
```
npm run test --watchAll=false --coverage /path/to/test/file
```
4. Viewing the code coverage of all test files:
```
npm install
npm run test --watchAll=false --coverage
```
2. Debug tests in browser
5. Debug tests in browser
You can see the output of failing tests in broswer by running `jest-preview` package before running your tests
```
npm install
npm run jest-preview
npm run test --watchAll=false --coverage
```
Expand All @@ -120,6 +139,46 @@ The process of proposing a change to Talawa Admin can be summarized as:
![Debugging Test Demo](./public/images/jest-preview.webp)
#### Vitest Testing
1. Running a single test:
```
npm run test:vitest /path/to/test/file
```
2. Running all tests:
```
npm run test:vitest
```
3. Viewing the code coverage of a single test file:
```
npm run test:vitest:coverage /path/to/test/file
```
4. Viewing the code coverage of all test files:
```
npm run test:vitest:coverage
```
#### Combined testing and coverage
1. Running all tests:
```
npm run test && npm run test:vitest
```
2. Viewing combined code coverage:
```
npm run test --watchAll=false --coverage && npm run test:vitest:coverage
```
3. **_Test Code Coverage_:**
1. _General Information_
Expand Down

0 comments on commit 3e1cf0a

Please sign in to comment.