Skip to content

Commit

Permalink
feat(tests): Init vitest test environment
Browse files Browse the repository at this point in the history
 - Added initial vitest configuration

 Installed testing deps:
  - Vitests
  - @nuxt/test-utils
  - happy-dom
  - playwright
  - @vue/test-utils
  • Loading branch information
lskellerm committed Sep 11, 2024
1 parent 6371431 commit 956954b
Show file tree
Hide file tree
Showing 5 changed files with 510 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/nuxt-container/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker",
"antfu.iconify",
"johnpapa.vscode-peacock"
"johnpapa.vscode-peacock",
"vitest.explorer",
"ms-playwright.playwright"
]
}
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default defineNuxtConfig({
'shadcn-nuxt',
'@nuxt/image',
'@nuxt/icon',
'@formkit/auto-animate/nuxt'
'@formkit/auto-animate/nuxt',
'@nuxt/test-utils/module'
],
tailwindcss: {
editorSupport: true
Expand Down
8 changes: 7 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"prepare": "cd .. && husky frontend/.husky"
"prepare": "cd .. && husky frontend/.husky",
"test": "vitest"
},
"dependencies": {
"@formkit/auto-animate": "^0.8.2",
Expand All @@ -35,13 +36,17 @@
"@iconify-json/lucide": "^1.2.2",
"@iconify-json/material-symbols": "^1.2.0",
"@nuxt/eslint": "^0.5.5",
"@nuxt/test-utils": "^3.14.2",
"@nuxtjs/tailwindcss": "^6.12.1",
"@playwright/test": "^1.47.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@vue/devtools-api": "^6.6.3",
"@vue/test-utils": "^2.4.6",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"happy-dom": "^15.7.3",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"nuxt": "^3.13.1",
Expand All @@ -50,6 +55,7 @@
"shadcn-nuxt": "^0.10.4",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
},
"lint-staged": {
Expand Down
8 changes: 8 additions & 0 deletions frontend/pages/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineVitestConfig } from '@nuxt/test-utils/config';

export default defineVitestConfig({
test: {
dir: 'tests',
environment: 'nuxt'
}
});
Loading

0 comments on commit 956954b

Please sign in to comment.