-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (32 loc) · 1.04 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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
const nextJest = require('next/jest')
// @ts-ignore
const createJestConfig = nextJest({
dir: './',
})
const customJestConfig = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleDirectories: ['node_modules', '<rootDir>/'],
setupFilesAfterEnv: ['./jest.setup.ts'],
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/components/$1',
'^@/pages/(.*)$': '<rootDir>/pages/$1',
'\\.(scss|sass|css)$': 'identity-obj-proxy',
},
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!./*.{js,jsx,ts,tsx}',
'!./pages/**/*.{js,jsx,ts,tsx}',
'!./services/**/*.{js,jsx,ts,tsx}',
'!./public/**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
},
transformIgnorePatterns: ['/node_modules/', '^.+\\.module\\.(css|sass|scss)$'],
}
module.exports = createJestConfig(customJestConfig)