Skip to content

Commit

Permalink
chore: add allure report for vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
kneerose committed Nov 7, 2024
1 parent 035509b commit 60a00a6
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ cloud-sql-proxy

# eslint config
eslint.config.mjs

allure-results
84 changes: 84 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"postinstall": "prisma generate",
"start": "next start",
"lint": "next lint",
"test": "vitest"
"test": "vitest",
"allure:generate": "npx allure generate ./allure-results --clean",
"allure:open": "npx allure open ./allure-report",
"allure:serve": "npx allure serve"
},
"dependencies": {
"@emotion/react": "^11.13.3",
Expand Down Expand Up @@ -39,6 +42,8 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/runner": "^2.1.4",
"allure-vitest": "^3.0.6",
"eslint": "^8.57.1",
"eslint-config-next": "14.2.15",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -51,6 +56,7 @@
"ts-node": "^10.9.2",
"typescript": "^5",
"typescript-eslint": "^8.12.2",
"vitest": "^2.1.4"
"vitest": "^2.1.4",
"allure-commandline": "^2.27.0"
}
}
13 changes: 11 additions & 2 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
setupFiles: ['vitest.setup.ts'],
exclude:['node_modules','integration_test']
setupFiles: ['vitest.setup.ts','allure-vitest/setup'],
exclude:['integration_test', 'node_modules'],
reporters: [
'verbose',
[
'allure-vitest/reporter',
{
resultsDir: 'allure-results',
},
],
],
},
resolve: {
alias: {
Expand Down

0 comments on commit 60a00a6

Please sign in to comment.