Skip to content

Commit b29ef07

Browse files
committed
switch to c8 for better code coverage accuracy
1 parent 93de39e commit b29ef07

15 files changed

+318
-1682
lines changed

.c8rc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"src": ["src/lib"],
3+
"include": ["dist/src/lib/**/*.js"],
4+
"exclude": ["dist/src/lib/index.js"],
5+
"extension": [".js"],
6+
"reporter": ["lcovonly", "text"],
7+
"all": true
8+
}

.github/workflows/main.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
permissions:
12+
checks: write
1213
contents: read
1314
strategy:
1415
matrix:
@@ -29,10 +30,26 @@ jobs:
2930
node-version: ${{ matrix.node-version }}
3031
- run: npm install
3132
- run: npm run lint
32-
- run: npm run build
33-
- run: node ./dist/src/cli.js --help
3433
- run: npm run coverage
34+
- run: node ./dist/src/cli.js --help
3535
- name: Upload coverage reports to Codecov
3636
uses: codecov/codecov-action@v6
37+
if: ${{ !cancelled() && matrix.node-version == 'latest' }}
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
report_type: coverage
41+
files: ./coverage/lcov.info
42+
disable_search: true
43+
- name: Upload test results to Codecov
44+
uses: codecov/codecov-action@v6
45+
if: ${{ !cancelled() && matrix.node-version == 'latest' }}
3746
with:
3847
token: ${{ secrets.CODECOV_TOKEN }}
48+
report_type: test_results
49+
files: ./test-results.xml
50+
disable_search: true
51+
- name: Publish test report
52+
uses: mikepenz/action-junit-report@v6
53+
if: ${{ (success() || failure()) && matrix.node-version == 'latest' }}
54+
with:
55+
report_paths: ./test-results.xml

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
.vscode
2-
.idea
32
node_modules/
43
dist/
54
mise.toml
65
/*.tgz
7-
/.nyc_output
6+
/test-results.xml
87
/coverage
98
*.local.*

.mocharc.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"require": ["tsx"],
3-
"extension": ["ts"],
4-
"reporter": "spec",
5-
"spec": ["test/**/*.ts"]
2+
"extension": ["js", "ts"],
3+
"reporter": "spec"
64
}

codecov.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import eslint from '@eslint/js'
22
import tseslint from 'typescript-eslint'
33
import globals from 'globals'
4-
import { defineConfig } from 'eslint/config'
4+
import { defineConfig, globalIgnores } from 'eslint/config'
55
import eslintConfigPrettier from 'eslint-config-prettier/flat'
66

77
export default defineConfig([
8+
globalIgnores(['dist/**/*.{js,ts}']),
89
{
910
files: ['src/**/*.ts', 'test/**/*.ts'],
1011
extends: [
@@ -17,7 +18,6 @@ export default defineConfig([
1718
reportUnusedDisableDirectives: 'error',
1819
},
1920
languageOptions: {
20-
ecmaVersion: 2020,
2121
globals: globals.node,
2222
parserOptions: {
2323
project: ['./tsconfig.json'],

0 commit comments

Comments
 (0)