Skip to content

Commit

Permalink
Generate test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Jan 15, 2024
1 parent b5d1cfc commit 7838533
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run test-ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ node_modules
/public/build
.env

.dev.vars
.dev.vars

coverage
262 changes: 262 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"start": "wrangler dev ./build/index.js",
"test": "vitest run",
"test-ci": "vitest run --coverage",
"typecheck": "tsc",
"prepare": "husky install"
},
Expand Down Expand Up @@ -40,6 +41,8 @@
"@types/recharts": "^1.8.29",
"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@vitest/coverage-istanbul": "^1.2.0",
"@vitest/coverage-v8": "^1.2.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.38.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -58,4 +61,4 @@
"engines": {
"node": ">=18.0.0"
}
}
}
10 changes: 10 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
coverage: {
provider: 'v8' // or 'v8'
},
},
})

0 comments on commit 7838533

Please sign in to comment.