feat: Add Jest testing infrastructure with comprehensive mocks and test scripts

- Add jest.config.js with Next.js integration, jsdom environment, module path mapping, and coverage collection for src/**/*.{js,jsx,ts,tsx}
- Add jest.setup.js with @testing-library/jest-dom, Next.js router/navigation mocks, IntersectionObserver/ResizeObserver/WebSocket/fetch mocks, localStorage/sessionStorage mocks
- Add package.json test scripts: test, test:watch, test:coverage
- Add testing dependencies: @testing-library/jest
This commit is contained in:
nutcas3
2026-04-20 18:08:04 +03:00
parent 961259cd39
commit 02af897c5f
16 changed files with 3226 additions and 2 deletions
+10 -1
View File
@@ -6,7 +6,10 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
},
"dependencies": {
"class-variance-authority": "^0.7.1",
@@ -25,8 +28,14 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"eslint": "^9",
"eslint-config-next": "16.2.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"tailwindcss": "^4",
"typescript": "^5"
}