-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
64 lines (64 loc) · 2.19 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
64
module.exports = {
// runner: 'tsc',
preset: 'ts-jest',
testEnvironment: 'node',
displayName: {
name: 'SpaceXplorerApi',
color: 'yellow',
},
moduleFileExtensions: ['ts', 'js'],
testMatch: [
'<rootDir>/__tests__/**/*.{js,ts,mjs}',
'<rootDir>/?(*.)(spec|test).{js,ts,mjs}',
'<rootDir>/src/**/__tests__/**/*.{js,ts,mjs}',
'<rootDir>/src/**/?(*.)(spec|test).{js,ts,mjs}',
],
setupFiles: ['<rootDir>/scripts/setup-tests.ts'],
collectCoverageFrom: ['<rootDir>/src/**/*.ts', '!**/node_modules/**'],
coveragePathIgnorePatterns: [
'/node_modules/',
'<rootDir>/src/config.ts',
'<rootDir>/src/server.ts',
'<rootDir>/src/data/db/db.ts',
'<rootDir>/src/data/api/model.ts',
'<rootDir>/src/data/api/mocks.ts',
'<rootDir>/src/data/db/mocks.ts',
'<rootDir>/src/core/logger.ts',
'<rootDir>/src/core/cache.ts',
'<rootDir>/src/core/context.ts',
'<rootDir>/src/gql/schema.ts',
'<rootDir>/src/gql/launch/schema.ts',
'<rootDir>/src/gql/mission/schema.ts',
'<rootDir>/src/gql/mutation/schema.ts',
'<rootDir>/src/gql/query/schema.ts',
'<rootDir>/src/gql/user/schema.ts',
],
coverageThreshold: {
global: {
lines: 80,
statements: 80,
},
},
transform: {
'^.+\\.ts$': 'ts-jest',
},
moduleNameMapper: {
'^@app': '<rootDir>/src/app.ts',
'^@config': '<rootDir>/src/config.ts',
'^@launchApi': '<rootDir>/src/data/api/LaunchApi.ts',
'^@userRepo': '<rootDir>/src/data/db/UserRepository.ts',
'^@database': '<rootDir>/src/database',
'^@database/(.*)$': '<rootDir>/src/database/$1',
'^@core/(.*)$': '<rootDir>/src/core/$1',
'^@utils': '<rootDir>/src/utils.ts',
'^@logger': '<rootDir>/src/core/logger.ts',
'^@cache': '<rootDir>/src/core/cache.ts',
'^@context': '<rootDir>/src/core/context.ts',
'^@gql/(.*)$': '<rootDir>/src/gql/$1',
'^@launchResolver': '<rootDir>/src/gql/launch/launchResolver.ts',
'^@missionResolver': '<rootDir>/src/gql/mission/missionResolver.ts',
'^@mutationResolver': '<rootDir>/src/gql/mutation/mutationResolver.ts',
'^@queryResolver': '<rootDir>/src/gql/query/queryResolver.ts',
'^@userResolver': '<rootDir>/src/gql/user/userResolver.ts',
},
};