-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
35 lines (32 loc) · 1.17 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
30
31
32
33
34
35
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
collectCoverageFrom: [
'<rootDir>/tests/integration/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{js,jsx,ts,tsx}',
'!<rootDir>/src/pages/api/**/*',
'!<rootDir>/src/pages/poc/**/*',
],
moduleNameMapper: {
'^@/config/(.*)$': '<rootDir>/src/config/$1',
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/services/(.*)$': '<rootDir>/src/services/$1',
'^@/maps/(.*)$': '<rootDir>/src/maps/$1',
'^@/styles/(.*)$': '<rootDir>/src/styles/$1',
'^@/redux/(.*)$': '<rootDir>/src/redux/$1',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/utils/(.*)$': '<rootDir>/src/utils/$1',
'^@/lib/(.*)$': '<rootDir>/src/lib/$1',
'^@/tests/(.*)$': '<rootDir>/tests/$1',
},
bail: true,
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
moduleDirectories: ['node_modules', '<rootDir>/'],
roots: ['<rootDir>/src/', '<rootDir>/tests/'],
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
testEnvironment: 'jest-environment-jsdom',
};
module.exports = createJestConfig(config);