ValidConfig.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 _jestRegexUtil() {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _jestValidate() {
  14. const data = require('jest-validate');
  15. _jestValidate = function _jestValidate() {
  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. browser: false,
  34. cache: true,
  35. cacheDirectory: '/tmp/user/jest',
  36. changedFilesWithAncestor: false,
  37. changedSince: 'master',
  38. clearMocks: false,
  39. collectCoverage: true,
  40. collectCoverageFrom: ['src', '!public'],
  41. collectCoverageOnlyFrom: {
  42. '<rootDir>/this-directory-is-covered/Covered.js': true
  43. },
  44. coverageDirectory: 'coverage',
  45. coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
  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. providesModuleNodeModules: ['react', 'react-native'],
  77. throwOnModuleCollision: false
  78. },
  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. preset: 'react-native',
  98. prettierPath: '<rootDir>/node_modules/prettier',
  99. projects: ['project-a', 'project-b/'],
  100. reporters: [
  101. 'default',
  102. 'custom-reporter-1',
  103. [
  104. 'custom-reporter-2',
  105. {
  106. configValue: true
  107. }
  108. ]
  109. ],
  110. resetMocks: false,
  111. resetModules: false,
  112. resolver: '<rootDir>/resolver.js',
  113. restoreMocks: false,
  114. rootDir: '/',
  115. roots: ['<rootDir>'],
  116. runTestsByPath: false,
  117. runner: 'jest-runner',
  118. setupFiles: ['<rootDir>/setup.js'],
  119. setupFilesAfterEnv: ['<rootDir>/testSetupFile.js'],
  120. silent: true,
  121. skipFilter: false,
  122. skipNodeResolution: false,
  123. snapshotResolver: '<rootDir>/snapshotResolver.js',
  124. snapshotSerializers: ['my-serializer-module'],
  125. testEnvironment: 'jest-environment-jsdom',
  126. testEnvironmentOptions: {
  127. userAgent: 'Agent/007'
  128. },
  129. testFailureExitCode: 1,
  130. testLocationInResults: false,
  131. testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
  132. testNamePattern: 'test signature',
  133. testPathIgnorePatterns: [NODE_MODULES_REGEXP],
  134. testRegex: (0, _jestValidate().multipleValidOptions)(
  135. '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
  136. ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$']
  137. ),
  138. testResultsProcessor: 'processor-node-module',
  139. testRunner: 'jasmine2',
  140. testSequencer: '@jest/test-sequencer',
  141. testTimeout: 5000,
  142. testURL: 'http://localhost',
  143. timers: 'real',
  144. transform: {
  145. '^.+\\.js$': '<rootDir>/preprocessor.js'
  146. },
  147. transformIgnorePatterns: [NODE_MODULES_REGEXP],
  148. unmockedModulePathPatterns: ['mock'],
  149. updateSnapshot: true,
  150. useStderr: false,
  151. verbose: false,
  152. watch: false,
  153. watchPathIgnorePatterns: ['<rootDir>/e2e/'],
  154. watchPlugins: [
  155. 'path/to/yourWatchPlugin',
  156. [
  157. 'jest-watch-typeahead/filename',
  158. {
  159. key: 'k',
  160. prompt: 'do something with my custom prompt'
  161. }
  162. ]
  163. ],
  164. watchman: true
  165. };
  166. var _default = initialOptions;
  167. exports.default = _default;