-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
93 lines (90 loc) · 2.28 KB
/
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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { getSDKs } from './harness/types'
const commonConfig = {
preset: '@eresearchqut/jest-testcontainers',
transform: {
'^.+\\.tsx?$': ['ts-jest', {}],
},
globalSetup: './jest-global.ts',
testEnvironment: './jest-environment.ts',
setupFilesAfterEnv: ['./jest-setup.js'],
}
const projects = [
{
...commonConfig,
displayName: 'NodeJS',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'NodeJS',
},
},
{
...commonConfig,
displayName: 'OF-NodeJS',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'OF-NodeJS',
LOCAL_HOST_BINDING: '0.0.0.0',
},
runner: 'jest-serial-runner',
},
{
...commonConfig,
displayName: 'DotNet',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'DotNet',
LOCAL_HOST_BINDING: '0.0.0.0',
},
},
{
...commonConfig,
displayName: 'Go',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'Go',
LOCAL_HOST_BINDING: '0.0.0.0',
},
},
{
...commonConfig,
displayName: 'Ruby',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'Ruby',
LOCAL_HOST_BINDING: '0.0.0.0',
},
},
{
...commonConfig,
displayName: 'PHP',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'PHP',
LOCAL_HOST_BINDING: '0.0.0.0',
},
},
{
...commonConfig,
displayName: 'Java',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'Java',
LOCAL_HOST_BINDING: '0.0.0.0',
},
runner: 'jest-serial-runner',
},
{
...commonConfig,
displayName: 'Python',
globals: {
JEST_PROJECT_SDK_TO_TEST: 'Python',
LOCAL_HOST_BINDING: '0.0.0.0',
},
runner: 'jest-serial-runner',
},
]
const SDKs = getSDKs().map((sdkName) => sdkName.toLowerCase())
const filteredProjects = projects.filter((project) =>
SDKs.includes(project.displayName.toLowerCase()),
)
console.log(
`Running jest tests for SDKs: ${filteredProjects.map((project) => project.displayName).join(', ')}`,
)
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
testTimeout: 60000,
projects: filteredProjects,
}