feature: added jest config
This commit is contained in:
@@ -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)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import "@testing-library/jest-dom"
|
||||||
+3
-1
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user