Skip to content

Commit 62214d8

Browse files
authored
Merge pull request #1 from clayandgen/tests
Add tests
2 parents f20eaff + 8243b65 commit 62214d8

File tree

13 files changed

+1159
-1
lines changed

13 files changed

+1159
-1
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v4
18+
with:
19+
version: 10
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: pnpm
24+
- run: pnpm install --frozen-lockfile
25+
- name: Run tests with coverage
26+
run: |
27+
echo "## 🧪 Vitest Coverage" > coverage_output.txt
28+
echo '```' >> coverage_output.txt
29+
NO_COLOR=1 pnpm test:coverage 2>&1 | tee -a coverage_output.txt
30+
echo '```' >> coverage_output.txt
31+
32+
- name: Post coverage comment
33+
if: github.event_name == 'pull_request'
34+
uses: marocchino/sticky-pull-request-comment@v2
35+
with:
36+
header: vitest-coverage
37+
path: coverage_output.txt

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
tools/
33
*.gem
4+
coverage/

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"serve": "vite build --watch --mode dev-server",
88
"build": "vite build",
99
"lint": "eslint src",
10+
"test": "vitest run",
11+
"test:coverage": "vitest run --coverage",
12+
"test:watch": "vitest",
1013
"serve:standalone": "vite preview --mode standalone"
1114
},
1215
"dependencies": {
@@ -16,22 +19,25 @@
1619
"axios": "^1.7.7",
1720
"date-fns": "^4.1.0",
1821
"lodash": "^4.17.21",
22+
"regression": "^2.0.1",
1923
"single-spa-vue": "^3.0.0",
2024
"sprintf-js": "^1.1.3",
21-
"regression": "^2.0.1",
2225
"uplot": "^1.6.31"
2326
},
2427
"devDependencies": {
2528
"@vitejs/plugin-vue": "^6.0.1",
29+
"@vitest/coverage-v8": "^4.0.18",
2630
"@vue/eslint-config-prettier": "^9.0.0",
2731
"@vue/test-utils": "^2.4.6",
2832
"eslint": "^9.16.0",
2933
"eslint-config-prettier": "^9.1.0",
3034
"eslint-plugin-prettier": "^5.2.1",
3135
"eslint-plugin-vue": "^9.30.0",
36+
"globals": "^17.3.0",
3237
"prettier": "^3.3.3",
3338
"sass": "^1.80.4",
3439
"vite": "^7.2.1",
40+
"vitest": "^4.0.18",
3541
"vue": "^3.5.13",
3642
"vue-eslint-parser": "^9.4.3"
3743
}

0 commit comments

Comments
 (0)