Skip to content

Commit e2eb216

Browse files
authored
Merge pull request #40 from josephlouise74/feature/web
Setup Vitest Coverage Reporting for Coveralls Integration
2 parents 3bce179 + 125b55a commit e2eb216

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: FRUI Test Suite - Coverage Report
2+
on: ["push", "pull_request"]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Set up Node.js
9+
uses: actions/setup-node@v4
10+
with:
11+
node-version: '20.x'
12+
- name: Install dependencies
13+
run: yarn
14+
- name: Building Code
15+
run: yarn build
16+
- name: Run Tests
17+
run: yarn test
18+
- name: Make Report
19+
run: yarn report
20+
- name: Coveralls
21+
uses: coverallsapp/github-action@v2
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
"build:tsc:esm": "tsc -p ./tsconfig.esm.json",
9696
"build:docs": "tsx scripts/build.ts",
9797
"dev": "tsx scripts/develop.ts",
98-
"test": "vitest --config vitest.config.ts"
98+
"test": "vitest --config vitest.config.ts",
99+
"report": "vitest run --coverage"
99100
},
100101
"devDependencies": {
101102
"@codemirror/language-data": "6.5.1",

vitest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export default defineConfig({
1818
environment: 'jsdom',
1919
globals: true,
2020
coverage: {
21-
reporter: ['text', 'html']
21+
provider: 'v8',
22+
reportsDirectory: './coverage',
23+
reporter: ['text', 'html', 'lcov']
2224
},
2325
},
2426
} as UserConfig)

0 commit comments

Comments
 (0)