forked from loggi/desafio-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
29 lines (26 loc) · 1.02 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const nextJest = require('next/jest')
// Providing the path to your Next.js app which will enable loading next.config.js and .env files
const createJestConfig = nextJest({ dir: './' })
// Any custom config you want to pass to Jest
const customJestConfig = {
roots: ["<rootDir>/src"],
moduleFileExtensions: ["js", "jsx", "json", "node"],
testPathIgnorePatterns: ["/node_modules/"],
testEnvironment: "jsdom",
transform: {
"^.+\\.(js|jsx)$": "babel-jest",
},
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(js|jsx)$",
moduleNameMapper: {
"^.+\\.(css|less|scss)$": "identity-obj-proxy",
},
collectCoverageFrom: ["src/**/*.{js,jsx}"],
coverageDirectory: "coverage",
coveragePathIgnorePatterns: ["src/index.js"],
coverageReporters: ["json", "lcov", "text", "clover"],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
}
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js configuration, which is async
module.exports = createJestConfig(customJestConfig)