Skip to content

Commit e49497e

Browse files
committed
Enhance testing capabilities and coverage reporting
- Add coverage configuration to vitest for improved test reporting - Introduce a new GitHub Actions workflow for automated testing on push and pull requests - Update .gitignore to exclude coverage directory - Add @vitest/coverage-v8 as a development dependency for coverage analysis - Introduce a new test command for coverage reporting in package.json
1 parent c9e9d59 commit e49497e

File tree

5 files changed

+297
-1
lines changed

5 files changed

+297
-1
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run tests
25+
run: npm test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ yarn-error.log
3939
# Ignore coverage and test reports
4040
.coverage
4141
coverage.xml
42+
coverage/
4243
*.cover
4344
*.pyc
4445

package-lock.json

Lines changed: 258 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@
3535
"prepare": "npm run build",
3636
"watch": "tsc --watch",
3737
"test": "vitest run",
38-
"test:watch": "vitest"
38+
"test:watch": "vitest",
39+
"test:coverage": "vitest run --coverage"
3940
},
4041
"dependencies": {
4142
"@modelcontextprotocol/sdk": "^1.20.2",
4243
"dotenv": "^16.6.1"
4344
},
4445
"devDependencies": {
4546
"@types/node": "^20",
47+
"@vitest/coverage-v8": "^4.0.5",
4648
"shx": "^0.4.0",
4749
"typescript": "^5.9.3",
4850
"vitest": "^4.0.5"

0 commit comments

Comments
 (0)