Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coverage requirement for jest #50

Open
ryanhu021 opened this issue Feb 5, 2025 · 0 comments · May be fixed by #56
Open

Add coverage requirement for jest #50

ryanhu021 opened this issue Feb 5, 2025 · 0 comments · May be fixed by #56
Assignees
Labels
ci/cd Continuous integration/deployment ready Ready for sprint

Comments

@ryanhu021
Copy link
Collaborator

ryanhu021 commented Feb 5, 2025

Description
As we start expanding the codebase, we want to ensure that we are creating thorough unit tests for every piece of functionality. While we don't want to enforce a strict 100% line coverage, it helps to have a minimum line requirement to ensure we aren't leaving out big chunks of code.

A good baseline to start with is 80% for all source files. This ensures the majority of our code is covered and leaves room for WIP/untestable code.

Acceptance Criteria
Jest requires a global coverage threshold of 80% for branches, functions, lines, and statements. the npm test command fails if this requirement is not met.

Steps:

  • Modify the jest configuration to collect coverage from all source files in the /src folder
  • Add a global coverage threshold of 80%
  • Modify the npm test command in package.json to run jest --coverage instead of jest
  • Ensure npm test displays the coverage report

Additional Information

@ryanhu021 ryanhu021 added ci/cd Continuous integration/deployment ready Ready for sprint labels Feb 5, 2025
@HenryHorse HenryHorse linked a pull request Feb 11, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous integration/deployment ready Ready for sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants