ValidConfig.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _jestRegexUtil() {
  7. const data = require('jest-regex-util');
  8. _jestRegexUtil = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _jestValidate() {
  14. const data = require('jest-validate');
  15. _jestValidate = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. var _constants = require('./constants');
  21. /**
  22. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  23. *
  24. * This source code is licensed under the MIT license found in the
  25. * LICENSE file in the root directory of this source tree.
  26. */
  27. const NODE_MODULES_REGEXP = (0, _jestRegexUtil().replacePathSepForRegex)(
  28. _constants.NODE_MODULES
  29. );
  30. const initialOptions = {
  31. automock: false,
  32. bail: (0, _jestValidate().multipleValidOptions)(false, 0),
  33. cache: true,
  34. cacheDirectory: '/tmp/user/jest',
  35. changedFilesWithAncestor: false,
  36. changedSince: 'master',
  37. clearMocks: false,
  38. collectCoverage: true,
  39. collectCoverageFrom: ['src', '!public'],
  40. collectCoverageOnlyFrom: {
  41. '<rootDir>/this-directory-is-covered/Covered.js': true
  42. },
  43. coverageDirectory: 'coverage',
  44. coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
  45. coverageProvider: 'v8',
  46. coverageReporters: ['json', 'text', 'lcov', 'clover'],
  47. coverageThreshold: {
  48. global: {
  49. branches: 50,
  50. functions: 100,
  51. lines: 100,
  52. statements: 100
  53. }
  54. },
  55. dependencyExtractor: '<rootDir>/dependencyExtractor.js',
  56. displayName: (0, _jestValidate().multipleValidOptions)('test-config', {
  57. color: 'blue',
  58. name: 'test-config'
  59. }),
  60. errorOnDeprecated: false,
  61. expand: false,
  62. extraGlobals: [],
  63. filter: '<rootDir>/filter.js',
  64. forceCoverageMatch: ['**/*.t.js'],
  65. forceExit: false,
  66. globalSetup: 'setup.js',
  67. globalTeardown: 'teardown.js',
  68. globals: {
  69. __DEV__: true
  70. },
  71. haste: {
  72. computeSha1: true,
  73. defaultPlatform: 'ios',
  74. hasteImplModulePath: '<rootDir>/haste_impl.js',
  75. platforms: ['ios', 'android'],
  76. throwOnModuleCollision: false
  77. },
  78. injectGlobals: true,
  79. json: false,
  80. lastCommit: false,
  81. logHeapUsage: true,
  82. maxConcurrency: 5,
  83. maxWorkers: '50%',
  84. moduleDirectories: ['node_modules'],
  85. moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
  86. moduleLoader: '<rootDir>',
  87. moduleNameMapper: {
  88. '^React$': '<rootDir>/node_modules/react'
  89. },
  90. modulePathIgnorePatterns: ['<rootDir>/build/'],
  91. modulePaths: ['/shared/vendor/modules'],
  92. name: 'string',
  93. noStackTrace: false,
  94. notify: false,
  95. notifyMode: 'failure-change',
  96. onlyChanged: false,
  97. onlyFailures: false,
  98. preset: 'react-native',
  99. prettierPath: '<rootDir>/node_modules/prettier',
  100. projects: ['project-a', 'project-b/'],
  101. reporters: [
  102. 'default',
  103. 'custom-reporter-1',
  104. [
  105. 'custom-reporter-2',
  106. {
  107. configValue: true
  108. }
  109. ]
  110. ],
  111. resetMocks: false,
  112. resetModules: false,
  113. resolver: '<rootDir>/resolver.js',
  114. restoreMocks: false,
  115. rootDir: '/',
  116. roots: ['<rootDir>'],
  117. runTestsByPath: false,
  118. runner: 'jest-runner',
  119. setupFiles: ['<rootDir>/setup.js'],
  120. setupFilesAfterEnv: ['<rootDir>/testSetupFile.js'],
  121. silent: true,
  122. skipFilter: false,
  123. skipNodeResolution: false,
  124. slowTestThreshold: 5,
  125. snapshotResolver: '<rootDir>/snapshotResolver.js',
  126. snapshotSerializers: ['my-serializer-module'],
  127. testEnvironment: 'jest-environment-jsdom',
  128. testEnvironmentOptions: {
  129. userAgent: 'Agent/007'
  130. },
  131. testFailureExitCode: 1,
  132. testLocationInResults: false,
  133. testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
  134. testNamePattern: 'test signature',
  135. testPathIgnorePatterns: [NODE_MODULES_REGEXP],
  136. testRegex: (0,
  137. _jestValidate()
  138. .multipleValidOptions)('(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', [
  139. '/__tests__/\\.test\\.[jt]sx?$',
  140. '/__tests__/\\.spec\\.[jt]sx?$'
  141. ]),
  142. testResultsProcessor: 'processor-node-module',
  143. testRunner: 'jasmine2',
  144. testSequencer: '@jest/test-sequencer',
  145. testTimeout: 5000,
  146. testURL: 'http://localhost',
  147. timers: 'real',
  148. transform: {
  149. '\\.js$': '<rootDir>/preprocessor.js'
  150. },
  151. transformIgnorePatterns: [NODE_MODULES_REGEXP],
  152. unmockedModulePathPatterns: ['mock'],
  153. updateSnapshot: true,
  154. useStderr: false,
  155. verbose: false,
  156. watch: false,
  157. watchPathIgnorePatterns: ['<rootDir>/e2e/'],
  158. watchPlugins: [
  159. 'path/to/yourWatchPlugin',
  160. [
  161. 'jest-watch-typeahead/filename',
  162. {
  163. key: 'k',
  164. prompt: 'do something with my custom prompt'
  165. }
  166. ]
  167. ],
  168. watchman: true
  169. };
  170. var _default = initialOptions;
  171. exports.default = _default;