diff --git a/.gitignore b/.gitignore index 30acefd..68a380b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ cloud-sql-proxy # eslint config eslint.config.mjs + +allure-results \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c510206..70b223f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,9 @@ "@types/react": "^18", "@types/react-dom": "^18", "@vitejs/plugin-react": "^4.3.3", + "@vitest/runner": "^2.1.4", + "allure-commandline": "^2.27.0", + "allure-vitest": "^3.0.6", "eslint": "^8.57.1", "eslint-config-next": "14.2.15", "eslint-config-prettier": "^9.1.0", @@ -4179,6 +4182,48 @@ "ajv": "^6.9.1" } }, + "node_modules/allure-commandline": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.32.0.tgz", + "integrity": "sha512-W03ors+ks8uy0SgQILHQvtvR0iadAfDYmTFC3p8Pk4pi8KXUW1cF+z8FN2+7deH3FE2cuYgjhhA+CdLdJfzOMQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "allure": "bin/allure" + } + }, + "node_modules/allure-js-commons": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.6.tgz", + "integrity": "sha512-q3r3Cj3sG6hR7jH8SGkfNleLJK+yFAGwzyFDGzIfu+WLZ4yeFcBZHkWuq7QreRpxvsZWNby/38jhrj5yYFwQ2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "md5": "^2.3.0" + }, + "peerDependencies": { + "allure-playwright": "3.0.6" + }, + "peerDependenciesMeta": { + "allure-playwright": { + "optional": true + } + } + }, + "node_modules/allure-vitest": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/allure-vitest/-/allure-vitest-3.0.6.tgz", + "integrity": "sha512-4mAeEwlKZpmdcjSWDjklNlneN6L1ExkDo5sLvO/fdlyyw7w7zW4nLiAaxwp7tYl0n61BJHQpw7lXtZHrdX/gRg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "allure-js-commons": "3.0.6" + }, + "peerDependencies": { + "@vitest/runner": ">=1.3.0", + "vitest": ">=1.3.0" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -4672,6 +4717,16 @@ "node": ">=8" } }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/check-error": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", @@ -4894,6 +4949,16 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/cssstyle": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.1.0.tgz", @@ -6676,6 +6741,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "license": "MIT" + }, "node_modules/is-bun-module": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.2.1.tgz", @@ -7340,6 +7412,18 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", diff --git a/package.json b/package.json index 930d5f9..9ca83e6 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } } diff --git a/vitest.config.mts b/vitest.config.mts index d02fb57..a1d677e 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -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: {