10. 06. 2025 • 4 min read
Validated: Jun 2025
Code coverage is a metric that shows what percentage of your codebase is executed when running tests. When your tests include meaningful assertions, you can be more confident that things work and that future changes won’t break anything unexpectedly. Code coverage also helps identify untested parts of your code, allowing you to improve test quality over time.
Currently, we support code coverage for JavaScript and TypeScript only. Support for additional languages is coming soon. If there's a specific language you'd like us to prioritize, feel free to reach out at support@codeac.io.
If you’re using Jest, collecting coverage is really simple. Just add a few lines to your jest.config.js
:
Now, when you run your tests with npx jest
, Jest will produce a nice little file at <pathWhereToStoreYourCoverageLogs>/lcov.info
. This is the exact format Codeac understands, so no extra conversions or tooling is required.
Before we can get that LCOV file into Codeac, we need a way for your CI pipeline to talk to us securely.
In your repository settings on Codeac.io, generate a Token. This token allows your CI pipeline to securely upload the <pathWhereToStoreYourCoverageLogs>/lcov.info
file to Codeac.
In your CI environment, store the token as a secret in your CI environment (e.g. TOKEN
).
Once your tests are done and the lcov.info
file is generated, it’s time to upload it.
Here’s a simple curl
command you can drop into your CI script:
This pushes the coverage report to Codeac, tied to the commit and branch that triggered the pipeline.
Codeac and your CI pipeline run in parallel, so code quality and coverage results may appear in the UI at different times. It can take a few minutes for all results to show up.
Once the report is uploaded, you can view coverage results directly in Codeac in several places:
This helps you maintain healthy testing habits as your codebase grows.
Sometimes it's not enough to just see coverage, you want to enforce a standard.
That’s where thresholds come in. Codeac already supports thresholds for issues. Now, you can combine those with Code Coverage thresholds to get a single, unified commit status.
Here's an example of .codeac.yml
file to get you started:
The result? Codeac will report a failed commit status if these thresholds aren't met, just like it does when your code has too many issues. It’s a great way to reinforce your testing and coding standards together.
These thresholds show up in your Git provider as part of the CI status. Clicking that status leads directly to the detailed Codeac analysis, where you can dig into both code issues and coverage insights in one place.
Adding Code Coverage to your Codeac workflow only takes a few minutes, but the visibility it gives you can be game-changing. You’ll quickly spot weak spots in your tests. By combining coverage with existing issue thresholds, you get a single, unified commit status that reflects both code quality and code coverage. It helps you enforce testing standards automatically, and keep your team confident in the code they ship.
If you have any feedback, questions, or suggestions on how we can improve this feature, please don’t hesitate to reach out at support@codeac.io. We’d love to hear from you. So go ahead and give it a try.