-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
63 lines (63 loc) · 1.71 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
59
60
61
62
63
module.exports = {
globalSetup: '<rootDir>/backend/__tests__/globals/setup.js',
globalTeardown: '<rootDir>/backend/__tests__/globals/teardown.js',
projects: [
{
collectCoverage: true,
displayName: 'frontend',
globals: {
'ts-jest': {
tsConfig: './frontend/__tests__/tsconfig.test.json'
}
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
name: 'frontend',
preset: 'ts-jest',
setupFiles: ['./frontend/jest.setup.js'],
testEnvironment: 'jsdom',
testMatch: ['**/frontend/__tests__/**/*.test.tsx'],
testPathIgnorePatterns: ['.next'],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': '<rootDir>/frontend/__tests__/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg|png|jpg|jpeg)$':
'<rootDir>/frontend/__tests__/__mocks__/fileMock.js'
}
},
{
collectCoverage: true,
displayName: 'backend',
globals: {
'ts-jest': {
tsConfig: './tsconfig.server.json'
}
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
name: 'backend',
preset: 'ts-jest',
testEnvironment: '<rootDir>/backend/__tests__/globals/env.js',
testMatch: ['**/backend/__tests__/**/*.test.ts'],
testPathIgnorePatterns: ['dist']
},
{
collectCoverage: true,
displayName: 'e2e',
globals: {
'ts-jest': {
tsConfig: './tsconfig.server.json'
// tsConfig: './tsconfig.json'
}
},
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
name: 'e2e',
preset: 'jest-puppeteer',
testEnvironment: '<rootDir>/backend/__tests__/globals/env.js',
testMatch: ['**/e2e/**/*.test.ts'],
testPathIgnorePatterns: ['dist']
}
],
testPathIgnorePatterns: ['<rootDir>/node_modules/', 'dist/'],
verbose: true
};