-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.mjs
36 lines (33 loc) · 1.07 KB
/
jest.config.mjs
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
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './'
});
const customJestConfig = {
collectCoverageFrom: ['**/*.{ts,tsx}'],
coveragePathIgnorePatterns: [
'node_modules',
'<rootDir>/.*.stories.tsx$',
'codegen.ts',
'<rootDir>/.storybook/*',
'<rootDir>/src/pages/*',
'<rootDir>/src/test-utils/*'
],
coverageReporters: ['html', 'json', 'json-summary', 'text', 'text-summary'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
setupFiles: ['<rootDir>/jest.setup.js'],
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'jest-axe/extend-expect',
'react-intersection-observer/test-utils',
'<rootDir>/setupTests.js'
],
testEnvironment: 'jest-environment-jsdom',
testRegex: '(/test/.*|\\.(test|spec))\\.(ts|tsx)$',
testPathIgnorePatterns: ['<rootDir>/src/test-utils/*'],
transform: {
'\\.(gql|graphql)$': '@graphql-tools/jest-transform'
}
};
export default createJestConfig(customJestConfig);