-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathjest.config.js
30 lines (27 loc) · 909 Bytes
/
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
30
/* eslint-disable no-undef */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require('next/jest');
const createJestConfig = nextJest({ dir: './' });
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/.jest/setup.ts'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['/node_modules', '/.next/'],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/@types/**/*',
'!src/pages/**/*',
'!src/constants/**/*',
'!src/styles/**/*',
'!src/**/*.stories.tsx',
'!src/**/styles.ts',
'!src/**/types.ts'
],
modulePaths: ['<rootDir>/src/', '<rootDir>/.jest'],
moduleNameMapper: {
'\\.(css|scss)$': 'react-toastify',
'^styled-components':
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js'
}
};
module.exports = createJestConfig(customJestConfig);