forked from remirror/remirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.e2e.js
51 lines (47 loc) · 1.42 KB
/
jest.config.e2e.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
const { server: __SERVER__ } = require('testing/playwright');
const config = require('./support/jest/jest.config');
const { jestSupportDir } = require('./support/jest/helpers');
const { E2E_ENVIRONMENT = 'playwright' } = process.env;
const environment = {
playwright: {
globalSetup: jestSupportDir('./jest.playwright.setup.ts'),
globalTeardown: jestSupportDir('./jest.playwright.teardown.ts'),
testRunner: 'jest-circus/runner',
preset: 'jest-playwright-preset',
testEnvironment: jestSupportDir('./jest.playwright.environment.js'),
setupFilesAfterEnv: [
'expect-playwright',
'jest-playwright-preset/lib/extends.js',
jestSupportDir('jest.framework.ts'),
jestSupportDir('jest.framework.e2e.ts'),
],
},
}[E2E_ENVIRONMENT];
const {
clearMocks,
verbose,
moduleFileExtensions,
globals,
transform,
testPathIgnorePatterns,
moduleNameMapper,
} = config;
/** @type Partial<import("@jest/types").Config.InitialOptions> */
module.exports = {
clearMocks,
verbose,
moduleFileExtensions,
transform,
testPathIgnorePatterns,
moduleNameMapper,
globals: { ...globals, __SERVER__, __E2E__: true },
cacheDirectory: '<rootDir>/.jest',
modulePathIgnorePatterns: ['node_modules'],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
displayName: {
name: 'remirror:e2e',
color: 'black',
},
testMatch: __SERVER__.testMatch,
...environment,
};