Skip to content

Commit

Permalink
adding test coverage tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
flothjl authored and finn-block committed Oct 4, 2023
1 parent d1e3cb8 commit a680b7a
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"all": true,
"cache": false,
"extension": [".js"],
"include": ["dist/esm/src/**"],
"exclude": ["dist/esm/src/types/**"],
"reporter": ["text", "cobertura"]
}
5 changes: 5 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ jobs:

- name: Run linter
run: npm run lint

- name: Upload test coverage to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ etc
node_modules
tmp
dwn.db
coverage
4 changes: 3 additions & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"enable-source-maps": true
"enable-source-maps": true,
"exit": true,
"spec": ["dist/esm/tests/**/*.spec.js"]
}
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ We take our open-source community seriously. Please adhere to our [Code of Condu
- This is run via CI whenever a pull request is opened, or a commit is pushed to a branch that has an open PR.
- Make sure to cover added code with tests, if it should be tested

### Test Coverage Expectations

To maintain the robustness and reliability of the codebase, we highly value test coverage.

- [Codecov](https://app.codecov.io/github/TBD54566975/dwn-server) is used to track
the coverage of our tests and will automatically comment on every pull request
showing the impact to overall coverage.
- We have a strong expectation for every pull request to strive for 100% test
coverage. This means that all new code you contribute should be fully covered
by tests, and it should not decrease the overall test coverage of the project.
- If your pull request introduces new features or changes existing logic, please
ensure you include comprehensive tests that cover edge-cases and failure
scenarios. This ensures that your contributions are of the highest quality and
safeguards our codebase against potential bugs or breaking changes.
- Thorough tests are also a great way to better understand your proposed changes.
- If you encounter any difficulties while writing tests, don't hesitate to reach
out for help or guidance in our Web5
[Discord](https://discord.com/channels/937858703112155166/1068273971432280196)
channel.

### Code Style

- Our preferred code style has been codified into `eslint` and `prettier`.
Expand Down
Loading

0 comments on commit a680b7a

Please sign in to comment.