Skip to content

Commit b297f9d

Browse files
test: compare coverage (#652)
* test: compare coverage * test: update test coverage * ci: remove rc * test: update test coverage --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6665c94 commit b297f9d

File tree

3 files changed

+113
-9
lines changed

3 files changed

+113
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ jobs:
6060

6161
- name: Tests
6262
run: npm run test
63+
64+
- name: Compare coverage
65+
if: github.ref != 'refs/heads/master'
66+
run:
67+
npx npxie coverage-comparison "${{ github.repository }}" "master" "${{ github.head_ref }}"
68+
"test/coverage/coverage-summary.json" "${{ github.event.pull_request.number }}" "${{ secrets.GITHUB_TOKEN }}"

jest.config.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,10 @@ export default async (): Promise<Config.InitialOptions> => {
5959
}
6060

6161
return {
62-
// Indicates whether the coverage information should be collected while executing the test
63-
// collectCoverage: false,
64-
65-
// The directory where Jest should output its coverage files
62+
collectCoverage: true,
6663
coverageDirectory: 'coverage',
67-
68-
// An array of regexp pattern strings used to skip coverage collection
69-
coveragePathIgnorePatterns: ['/node_modules/'],
70-
71-
// An array of directory names to be searched recursively up from the requiring module's location
64+
coverageReporters: ['lcov', 'json-summary'],
65+
collectCoverageFrom: ['src/**/*.ts'],
7266
moduleDirectories: ['node_modules'],
7367

7468
// Run tests from one or more projects

0 commit comments

Comments
 (0)