forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.unit.config.ts
74 lines (71 loc) · 2.24 KB
/
jest.unit.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
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
65
66
67
68
69
70
71
72
73
74
import { Config } from '@jest/types'
import { defaults as tsjPreset } from 'ts-jest/presets'
// Required in order for the Jest VS Code Extension to work properly
process.env.NATIVE_EXTENSIONS_DIR = 'build/native-extensions'
const config: Config.InitialOptions = {
preset: 'ts-jest',
projects: [
{
rootDir: 'packages/bp/src',
displayName: { name: 'botpress', color: 'green' },
globals: {
'ts-jest': {
tsconfig: '<rootDir>../tsconfig.json'
}
},
transform: {
...tsjPreset.transform
},
setupFiles: ['<rootDir>/jest-before.ts'],
setupFilesAfterEnv: ['jest-extended/all'],
globalSetup: '<rootDir>/jest-rewire.ts',
resolver: '<rootDir>/jest-resolver.js',
modulePaths: ['<rootDir>/'],
moduleNameMapper: {
'^botpress/sdk$': '<rootDir>/core/app/sdk_impl'
},
testPathIgnorePatterns: ['.*integration\\.test\\.(?:ts|js)'],
testEnvironment: 'node'
},
{
rootDir: '.',
displayName: { name: 'modules', color: 'red' },
globals: {
'ts-jest': {
tsconfig: '<rootDir>/packages/bp/tsconfig.json',
diagnostics: false
}
},
transform: {
...tsjPreset.transform
},
setupFiles: ['<rootDir>/packages/bp/src/jest-before.ts'],
globalSetup: '<rootDir>/packages/bp/src/jest-rewire.ts',
resolver: '<rootDir>/packages/bp/src/jest-resolver.js',
resetModules: true,
moduleNameMapper: {
'^botpress/sdk$': '<rootDir>/packages/bp/src/core/app/sdk_impl'
},
testMatch: ['<rootDir>/modules/**/(src|test)/**/*.test.(ts|js)'],
testPathIgnorePatterns: ['.*(integration|mock)\\.test\\.(?:ts|js)', '.*\\.u\\.test\\.(?:ts|js)'],
modulePaths: ['<rootDir>/packages/bp/src/'],
testEnvironment: 'node'
},
{
rootDir: './packages/ui-shared-lite',
displayName: { name: 'ui-shared-lite', color: 'yellow' },
clearMocks: true,
testEnvironment: 'jsdom',
transform: {
...tsjPreset.transform
},
modulePaths: ['<rootDir>/packages/ui-shared-lite/'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>../ui-shared/tsconfig.json'
}
}
}
]
}
export default config