- Visit https://codecov.io
- Click "Sign up with GitHub"
- Authorize Codecov to access your repositories
- In Codecov dashboard, click "Add new repository"
- Find and select
sublime247/mobile-money - Copy the upload token shown
- Go to https://github.com/sublime247/mobile-money/settings/secrets/actions
- Click "New repository secret"
- Name:
CODECOV_TOKEN - Value: [paste the token from Step 2]
- Click "Add secret"
- Push code to main branch or create a PR
- Go to GitHub Actions tab
- Wait for CI workflow to complete
- Check Codecov dashboard for coverage report
- Verify badge appears in README
[](https://codecov.io/gh/sublime247/mobile-money)<!-- Flat style -->
[](https://codecov.io/gh/sublime247/mobile-money)
<!-- Flat-square style -->
[](https://codecov.io/gh/sublime247/mobile-money)
<!-- For-the-badge style -->
[](https://codecov.io/gh/sublime247/mobile-money)- Minimum coverage: 70%
- Threshold variance: 2%
- Fail CI if coverage drops below threshold
Edit jest.config.js:
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70
}
}Edit codecov.yml:
coverage:
status:
project:
default:
target: 70%
threshold: 2%Codecov automatically comments on PRs with:
- Coverage percentage change
- Lines covered/uncovered
- File-by-file breakdown
- Visual diff of coverage changes
- Line-by-line coverage in Codecov UI
- Sunburst chart of project coverage
- Coverage trends over time
- Commit-by-commit tracking
Configure in Codecov settings:
- Slack notifications
- Email alerts
- Webhook integrations
- Wait 5-10 minutes after first push
- Verify workflow completed successfully
- Check Codecov received the upload
- Clear browser cache
# Check GitHub Actions logs for errors
# Common issues:
# 1. CODECOV_TOKEN not set
# 2. Coverage file not generated
# 3. Network issues
# Verify locally:
npm run test:coverage
ls -la coverage/lcov.info # Should exist- Regenerate token in Codecov settings
- Update GitHub secret with new token
- Re-run failed workflow
- Check
codecov.ymlignore patterns - Verify
jest.config.jscollectCoverageFrom - Ensure tests are actually running
npm run test:coverage# Linux
xdg-open coverage/lcov-report/index.html
# macOS
open coverage/lcov-report/index.html
# Windows
start coverage/lcov-report/index.html# Will fail if below 70%
npm run test:coverageIf you prefer Coveralls over Codecov:
1. Sign up at https://coveralls.io
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}[](https://coveralls.io/github/sublime247/mobile-money?branch=main)- Complete Codecov setup (Steps 1-4 above)
- Write tests for existing code
- Monitor coverage in PRs
- Aim to increase coverage over time
- Review uncovered code regularly