-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
58 lines (58 loc) · 1.74 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module.exports = {
globals: {
// we must specify a custom tsconfig for tests because we need the typescript transform
// to transform jsx into js rather than leaving it jsx such as the next build requires. you
// can see this setting in tsconfig.jest.json -> "jsx": "react"
'ts-jest': {
tsConfig: 'tsconfig.jest.json'
},
roots: ['<rootDir>'],
verbose: true,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: ['/node_modules/'],
coveragePathIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
'^src/(.*)': '<rootDir>/src/$1',
'\\.(css|less|sass|scss)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js'
}
},
projects: [
{
displayName: {
name: 'Unit',
color: 'green'
},
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/__tests__/testUtils/setupBeforeEnv.ts'],
setupFilesAfterEnv: ['@testing-library/jest-dom'],
testPathIgnorePatterns: [
'/node_modules/',
'__tests__/testUtils',
'__tests__/fixtures',
'__tests__/e2e'
],
moduleDirectories: ['node_modules', 'src'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest'
}
},
{
displayName: {
name: 'E2E',
color: 'blue'
},
setupFiles: ['<rootDir>/__tests__/testUtils/setupBeforeEnv.ts'],
setupFilesAfterEnv: [],
testPathIgnorePatterns: [
'/node_modules/',
'__tests__/testUtils',
'__tests__/fixtures',
'__tests__/unit'
],
moduleDirectories: ['node_modules', 'src']
}
],
testTimeout: 20000
}