feature: added jest config

This commit is contained in:
Dmitriy Bratchikov
2024-05-27 16:35:37 +07:00
parent 534f905a6a
commit 42a457cfc8
3 changed files with 73 additions and 46 deletions
+24
View File
@@ -0,0 +1,24 @@
import type { Config } from "jest"
import nextJest from "next/jest.js"
const createJestConfig = nextJest({
dir: "./",
})
const config: Config = {
coverageProvider: "v8",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
moduleNameMapper: {
"@app/(.*)$": "<rootDir>/src/app/$1",
"@entities/(.*)$": "<rootDir>/src/entities/$1",
"@features/(.*)$": "<rootDir>/src/features/$1",
"@pagesLayer/(.*)$": "<rootDir>/src/pagesLayer/$1",
"@shared/(.*)$": "<rootDir>/src/shared/$1",
"@widgets/(.*)$": "<rootDir>/src/widgets/$1",
"@/(.*)$": "<rootDir>/src/$1",
},
}
export default createJestConfig(config)
+1
View File
@@ -0,0 +1 @@
import "@testing-library/jest-dom"
+3 -1
View File
@@ -12,7 +12,9 @@
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"lint:prettier": "prettier . --write" "lint:prettier": "prettier . --write",
"test": "jest",
"test:watch": "jest --watch"
}, },
"dependencies": { "dependencies": {
"next": "14.2.3", "next": "14.2.3",