Skip to content

Commit

Permalink
Configure vitest to look for unit tests in "test" directory
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Feb 10, 2024
1 parent 21fb99f commit eba97cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
src/assets/typechain-types
/docker
playwright.config.ts
vitest.config.ts
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"build:windows": "for /F \"delims=\" %I in ('git rev-parse HEAD') do set \"NEXT_PUBLIC_GIT_HASH=%I\" && next build",
"graphql:build": "graphclient build",
"graphql:dev-server": "graphclient serve-dev",
"test": "npm run set:env & next test",
"test": "vitest --dir=test",
"prepare": "husky install",
"tests": "playwright test"
},
Expand Down
Empty file added test/.empty
Empty file.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"include": [
"src",
"tests",
"test",
"app",
".next/types/**/*.ts",
"next-env.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'

export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
},
})

0 comments on commit eba97cd

Please sign in to comment.