Skip to content

Commit 702181e

Browse files
committed
feature-296-bugbot-autofix: Update Jest configuration to include coverage settings and modify CI workflow to run tests with coverage and upload results to Codecov. Adjust status types in branch_repository.d.ts for clarity.
1 parent 70f0a4f commit 702181e

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

.github/workflows/ci_check.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ jobs:
2828
- name: Build
2929
run: npm run build
3030

31-
- name: Run tests
32-
run: npm test
31+
- name: Run tests with coverage
32+
run: npm run test:coverage
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v5
36+
with:
37+
directory: ./coverage
38+
fail_ci_if_error: true
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
verbose: true
3341

3442
- name: Lint
3543
run: npm run lint

build/github_action/src/data/repository/branch_repository.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export declare class BranchRepository {
3333
totalCommits: number;
3434
files: {
3535
filename: string;
36-
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
36+
status: "modified" | "added" | "removed" | "renamed" | "copied" | "changed" | "unchanged";
3737
additions: number;
3838
deletions: number;
3939
changes: number;

codecov.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Codecov configuration
2+
# Validate at: https://api.codecov.io/validate
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70..100"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 2%
13+
patch:
14+
default:
15+
target: 80%
16+
threshold: 2%
17+
18+
comment:
19+
layout: "diff, flags, files"
20+
behavior: default
21+
require_changes: false
22+
23+
ignore:
24+
- "**/__tests__/**"
25+
- "**/*.d.ts"
26+
- "build/**"

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module.exports = {
99
'!src/**/*.d.ts',
1010
'!src/**/__tests__/**'
1111
],
12+
coverageDirectory: 'coverage',
13+
coverageReporters: ['text', 'text-summary', 'lcov'],
1214
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
1315
transform: {
1416
'^.+\\.ts$': 'ts-jest'

0 commit comments

Comments
 (0)