Skip to content

Commit

Permalink
config: vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
shenshin committed Oct 9, 2024
1 parent 111b337 commit be44d0f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"paths": {
"@/*": ["./src/*"],
"@/public/*": ["./public/*"]
}
},
"types": [
"@testing-library/jest-dom"
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
Expand Down
15 changes: 15 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'

export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
setupFiles: './vitest.setup.ts',
},
resolve: {
alias: {
'@': '/src',
},
},
})
4 changes: 4 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { expect } from 'vitest'
import * as matchers from '@testing-library/jest-dom/matchers'

expect.extend(matchers)

0 comments on commit be44d0f

Please sign in to comment.