-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.mjs
More file actions
37 lines (34 loc) · 1.04 KB
/
jest.config.mjs
File metadata and controls
37 lines (34 loc) · 1.04 KB
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
30
31
32
33
34
35
36
37
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './',
});
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^@/(.*)$': '<rootDir>/src/$1',
},
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/', '<rootDir>/coverage/', '<rootDir>/dist/'],
collectCoverage: true,
collectCoverageFrom: [
'./src/**/*.{js,jsx,ts,tsx}',
'!./src/**/_*.{js,jsx,ts,tsx}',
'!./src/**/*.stories.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
coverageReporters: ['text', 'lcov', 'json', 'html'],
verbose: true,
testTimeout: 30000,
moduleDirectories: ['node_modules', '<rootDir>/'],
};
export default createJestConfig(customJestConfig);