Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test coverage #25

Merged
merged 22 commits into from
Mar 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor
KirillDogadin-std committed Mar 23, 2023
commit 786e63df16f8f2379cb368d556bc56c856af7d0d
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"postinstall": "prisma generate",
"lint": "eslint \"./**/*.{ts,tsx}\" --max-warnings=0",
"typecheck": "tsc --noEmit",
"test": "vitest run --coverage && vitest run --coverage --config ./vitest.full-coverage.config.ts"
"test": "vitest run && vitest run --config ./vitest.full-coverage.config.ts"
},
"dependencies": {
"@prisma/client": "^4.11.0",
4 changes: 3 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { defineConfig, UserConfigExport } from 'vitest/config';

export const getVitestConfig = (fullyCoveredModulePaths?: string[]): UserConfigExport => {
const coverage = !!fullyCoveredModulePaths && fullyCoveredModulePaths.length !== 0 ? 100 : 90;
const enableFullCoverage = !!fullyCoveredModulePaths && fullyCoveredModulePaths.length !== 0;
const coverage = enableFullCoverage ? 100 : 90;
return {
test: {
coverage: {
enabled: !enableFullCoverage,
provider: 'istanbul',
lines: coverage,
functions: coverage,