forked from catapultcx/animals-ui-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
37 lines (33 loc) · 928 Bytes
/
jest.config.ts
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 type { JestConfigWithTsJest } from 'ts-jest'
import nextJest from 'next/jest'
const createJestConfig = nextJest({
dir: './'
})
const customJestConfig = {
testEnvironment: 'jsdom',
verbose: true,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
testMatch: [
'<rootDir>/__tests__/**/*.test.ts',
'<rootDir>/__tests__/**/*.test.tsx'
],
moduleNameMapper: {
'^@/root(.*)$': '<rootDir>/$1',
'^@/components/(.*)$': '<rootDir>/src/components/$1',
'^@/pages/(.*)$': '<rootDir>/src/pages/$1',
'^@/services/(.*)$': '<rootDir>/src/services/$1',
'^(.*)\\.js$': '$1'
},
moduleDirectories: ['node_modules', '<rootDir>'],
coveragePathIgnorePatterns: [
'src/pages/_app.tsx',
'src/pages/_document.tsx',
'__tests__'
],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.tsx',
'src/**/*.ts'
]
}
export default createJestConfig(customJestConfig)