Skip to content

Commit c286e19

Browse files
authored
πŸ‘· Add coverage (#41)
* πŸ‘· Add coverage * πŸ™ˆ Ignore "coverage" in ESLint * πŸ”§ "include": ["src"] * 🏷️ eslint.config.ts * πŸ”§ Set coverage reporter to `json-summary` * πŸ‘· dependency-review-action * πŸ‘· Update coverage path in Node.js CI workflow to `coverage`
1 parent a31172e commit c286e19

File tree

9 files changed

+516
-106
lines changed

9 files changed

+516
-106
lines changed

β€Ž.github/workflows/github-pages.yamlβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: GitHub Pages
22

33
on:
44
push:
5-
branches: main
5+
branches:
6+
- main
67

78
jobs:
89
build_pages:
@@ -20,7 +21,11 @@ jobs:
2021
node-version: latest
2122
cache: pnpm
2223
- run: pnpm install
24+
2325
- run: pnpm run docs
26+
- run: pnpm run test:coverage
27+
- run: cp --force --recursive coverage docs/coverage
28+
2429
- uses: actions/upload-pages-artifact@v3
2530
with:
2631
path: docs

β€Ž.github/workflows/node.js.yamlβ€Ž

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ jobs:
2828
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
2929
- run: pnpm run build --noEmit
3030
- run: pnpm run lint
31-
- run: pnpm run test
31+
- run: pnpm run test:coverage
32+
33+
- uses: actions/upload-artifact@v4
34+
if: github.actor != 'nektos/act'
35+
with:
36+
name: coverage
37+
path: coverage
38+
if-no-files-found: error
39+
40+
- uses: actions/dependency-review-action@v4
3241

3342
fix:
3443
runs-on: ubuntu-latest

β€Ž.prettierignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.pnpm-store/
2+
coverage/
23
dist/
34
docs/
45
node_modules/
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import prettier from "eslint-config-prettier"
33
import globals from "globals"
44
import tseslint from "typescript-eslint"
55

6-
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */
7-
86
export default tseslint.config(
97
{
108
languageOptions: {
@@ -71,6 +69,7 @@ export default tseslint.config(
7169
{
7270
ignores: [
7371
".pnpm-store/",
72+
"coverage/",
7473
"dist/",
7574
"docs/",
7675
"node_modules/",

β€Žpackage.jsonβ€Ž

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,26 @@
4040
"lint": "eslint . && markdownlint-cli2 \"**/*.md\" && prettier --check .",
4141
"lint:fix": "eslint --fix --quiet .; markdownlint-cli2 \"**/*.md\" --fix; prettier --list-different --write .",
4242
"test": "vitest run",
43+
"test:coverage": "vitest run --coverage",
4344
"test:watch": "vitest"
4445
},
4546
"dependencies": {
4647
"dotenv": "^16.5.0"
4748
},
4849
"devDependencies": {
49-
"@eslint/js": "^9.27.0",
50+
"@eslint/js": "^9.28.0",
5051
"@types/node": "^22.15.23",
51-
"eslint": "^9.27.0",
52+
"@vitest/coverage-v8": "^3.1.4",
53+
"eslint": "^9.28.0",
5254
"eslint-config-prettier": "^10.1.5",
5355
"globals": "^16.2.0",
56+
"jiti": "^2.4.2",
5457
"markdownlint-cli2": "^0.18.1",
5558
"prettier": "^3.5.3",
5659
"tsx": "^4.19.4",
5760
"typedoc": "^0.28.5",
5861
"typescript": "5.8.3",
59-
"typescript-eslint": "^8.33.0",
62+
"typescript-eslint": "^8.33.1",
6063
"vitest": "^3.1.4"
6164
},
6265
"type": "module",

0 commit comments

Comments
Β (0)