-
Notifications
You must be signed in to change notification settings - Fork 629
/
jest.config.js
83 lines (76 loc) · 3.16 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @oncall react_native
*/
const testPathIgnorePatterns = [];
if (process.env.NIGHTLY_TESTS_NO_LOCKFILE) {
// flaky babel types test - this should be removed once babel is updated
testPathIgnorePatterns.push('__tests__/babel-lib-defs-test.js');
}
if (process.platform === 'win32') {
// TODO: fix on windows
testPathIgnorePatterns.push(
...[
// path mismatches
'packages/metro/src/__tests__/HmrServer-test.js',
'packages/metro/src/DeltaBundler/__tests__/buildSubgraph-test.js',
'packages/metro/src/DeltaBundler/__tests__/Graph-test.js',
'packages/metro/src/DeltaBundler/Serializers/helpers/__tests__/js-test.js',
'packages/metro/src/node-haste/lib/__tests__/AssetPaths-test.js',
'packages/metro/src/Server/__tests__/Server-test.js',
'packages/metro-config/src/__tests__/loadConfig-test.js',
'packages/metro-symbolicate/src/__tests__/symbolicate-test.js',
'packages/metro-file-map/src/__tests__/index-test.js',
'packages/metro-file-map/src/watchers/__tests__/WatchmanWatcher-test.js',
'packages/metro-file-map/src/crawlers/__tests__/node-test.js',
'packages/metro-file-map/src/watchers/__tests__/integration-test.js',
// resolveModulePath failed
'packages/metro-cache/src/stores/__tests__/FileStore-test.js',
'packages/metro-resolver/src/__tests__/assets-test.js',
'packages/metro-resolver/src/__tests__/platform-extensions-test.js',
'packages/metro-resolver/src/__tests__/symlinks-test.js',
// const {_cwd} = this; resolution issue in `metro-memory-fs/src/index.js:1294:15`
'packages/metro/src/__tests__/Assets-test.js',
'packages/metro/src/DeltaBundler/__tests__/resolver-test.js',
'packages/buck-worker-tool/src/__tests__/worker-test.js',
'packages/metro-transform-worker/src/__tests__/index-test.js',
'packages/metro-cache/src/stores/__tests__/AutoCleanFileStore-test.js',
'packages/metro-cache/src/stores/__tests__/FileStore-test.js',
// endless loading
'packages/metro-resolver/src/__tests__/browser-spec-test.js',
'packages/metro-resolver/src/__tests__/package-exports-test.js',
'packages/metro-resolver/src/__tests__/index-test.js',
// unclear issue
'packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js',
'packages/metro-file-map/src/crawlers/__tests__/integration-test.js',
],
);
}
/** @type {import('jest').Config} **/
module.exports = {
modulePathIgnorePatterns: ['/node_modules/', 'packages/[^/]+/build/'],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
testEnvironment: 'node',
testRegex: '/__tests__/.*-test\\.js$',
testPathIgnorePatterns,
fakeTimers: {
enableGlobally: true,
legacyFakeTimers: false,
},
transform: {
'\\.js$': '<rootDir>/scripts/babelJestTransformer.js',
},
setupFiles: ['<rootDir>/scripts/setupJest.js'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
};