Skip to content

Commit

Permalink
feat: add vitest and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitkolhe committed Mar 16, 2024
1 parent 6af020c commit dbe9ea4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"format": "prettier --write \"./**/*.{js,ts,json}\"",
"lint": "eslint .",
"lint:fix": "bun run lint --fix",
"test": "bun run vitest run",
"test:ui": "bun run vitest ui",
"deploy": "vercel deploy --prod",
"postinstall": "npx simple-git-hooks"
},
Expand All @@ -53,11 +55,14 @@
"@types/bun": "^1.0.8",
"@types/node": "^20.11.28",
"@types/node-forge": "^1.3.11",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"simple-git-hooks": "^2.10.0",
"simple-git-hooks": "^2.11.0",
"tsc-alias": "^1.8.8",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"vitest": "^1.4.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeAll, describe, expect, test } from 'bun:test'
import { beforeAll, describe, expect, test } from 'vitest'
import { GetSongByIdUseCase } from '#modules/songs/use-cases'

describe('GetSongById', () => {
Expand Down
18 changes: 18 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
testTimeout: 10000,
coverage: {
enabled: true,

provider: 'v8',
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
}
}
})

0 comments on commit dbe9ea4

Please sign in to comment.