generated from wikimedia-gadgets/twinkle-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
42 lines (41 loc) · 874 Bytes
/
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
const tsJestOptions = {
'ts-jest': {
diagnostics: {
warnOnly: true,
},
},
};
module.exports = {
projects: [
{
displayName: 'unit',
testMatch: ['<rootDir>/tests/unit/*.test.[jt]s'],
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['mock-mediawiki', './tests/expect-setup.ts'],
globals: {
...tsJestOptions,
},
},
{
displayName: 'integration',
testMatch: ['<rootDir>/tests/integration/*.test.[jt]s'],
preset: 'jest-playwright-preset',
transform: {
'^.+\\.ts$': 'ts-jest',
},
setupFilesAfterEnv: ['./tests/expect-setup.ts'],
testEnvironmentOptions: {
'jest-playwright': {
launchOptions: {
headless: !process.env.DEBUG,
},
browsers: process.env.DEBUG ? ['chromium'] : ['chromium', 'firefox', 'webkit'],
},
},
globals: {
...tsJestOptions,
},
},
],
};