-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
jest.config.js
58 lines (44 loc) · 1.87 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
/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* @format
* @ts-check
*/
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const assetTransform = 'react-native-windows/jest/assetFileTransformer.js';
module.exports = {
preset: '@rnx-kit/jest-preset',
// A list of paths to directories that Jest should use to search for files in
roots: ['<rootDir>/test/'],
// The test environment that will be used for testing
testEnvironment: '@react-native-windows/automation',
// The pattern or patterns Jest uses to detect test files
testRegex: '.*\\.test\\.ts$',
// Default timeout of a test in milliseconds
testTimeout: 70000,
// A map from regular expressions to paths to transformers
transform: {
'\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': assetTransform,
'node_modules\\\\@?react-native\\\\.*': 'babel-jest',
'@react-native-windows\\\\tester\\\\.*': 'babel-jest',
'vnext\\\\.*': 'babel-jest',
'\\.[jt]sx?$': 'babel-jest',
},
snapshotResolver: 'react-native-windows/jest-snapshot-resolver.js',
// An array of regexp pattern strings that are matched against all source file paths before transformation.
// If the file path matches any of the patterns, it will not be transformed.
transformIgnorePatterns: ['jest-runner'],
// Specifies the maximum number of workers the worker-pool will spawn for running tests.
maxWorkers: 1,
// Indicates whether each individual test should be reported during the run.
verbose: true,
// A list of paths to modules that run some code to configure or set up the testing framework
// before each test file in the suite is executed
setupFilesAfterEnv: ['react-native-windows/jest/setup', './jest.setup.js'],
testEnvironmentOptions: {
app: 'RNTesterApp',
enableAutomationChannel: true,
},
};