jest.config.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. * For a detailed explanation regarding each configuration property, visit:
  3. * https://jestjs.io/docs/configuration
  4. */
  5. module.exports = {
  6. // All imported modules in your tests should be mocked automatically
  7. // automock: false,
  8. // Stop running tests after `n` failures
  9. // bail: 0,
  10. // The directory where Jest should store its cached dependency information
  11. // cacheDirectory: "/tmp/jest_rs",
  12. // Automatically clear mock calls and instances between every test
  13. // clearMocks: false,
  14. // Indicates whether the coverage information should be collected while executing the test
  15. // collectCoverage: false,
  16. // An array of glob patterns indicating a set of files for which coverage information should be collected
  17. // collectCoverageFrom: undefined,
  18. // The directory where Jest should output its coverage files
  19. // coverageDirectory: undefined,
  20. // An array of regexp pattern strings used to skip coverage collection
  21. // coveragePathIgnorePatterns: [
  22. // "/node_modules/"
  23. // ],
  24. // Indicates which provider should be used to instrument code for coverage
  25. // coverageProvider: "babel",
  26. // A list of reporter names that Jest uses when writing coverage reports
  27. // coverageReporters: [
  28. // "json",
  29. // "text",
  30. // "lcov",
  31. // "clover"
  32. // ],
  33. // An object that configures minimum threshold enforcement for coverage results
  34. // coverageThreshold: undefined,
  35. // A path to a custom dependency extractor
  36. // dependencyExtractor: undefined,
  37. // Make calling deprecated APIs throw helpful error messages
  38. // errorOnDeprecated: false,
  39. // Force coverage collection from ignored files using an array of glob patterns
  40. // forceCoverageMatch: [],
  41. // A path to a module which exports an async function that is triggered once before all test suites
  42. // globalSetup: undefined,
  43. // A path to a module which exports an async function that is triggered once after all test suites
  44. // globalTeardown: undefined,
  45. // A set of global variables that need to be available in all test environments
  46. // globals: {},
  47. // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
  48. // maxWorkers: "50%",
  49. // An array of directory names to be searched recursively up from the requiring module's location
  50. // moduleDirectories: [
  51. // "node_modules"
  52. // ],
  53. // An array of file extensions your modules use
  54. // moduleFileExtensions: [
  55. // "js",
  56. // "jsx",
  57. // "ts",
  58. // "tsx",
  59. // "json",
  60. // "node"
  61. // ],
  62. // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
  63. moduleNameMapper: {},
  64. // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
  65. // modulePathIgnorePatterns: [],
  66. // Activates notifications for test results
  67. // notify: false,
  68. // An enum that specifies notification mode. Requires { notify: true }
  69. // notifyMode: "failure-change",
  70. // A preset that is used as a base for Jest's configuration
  71. // preset: undefined,
  72. // Run tests from one or more projects
  73. // projects: undefined,
  74. // Use this configuration option to add custom reporters to Jest
  75. // reporters: undefined,
  76. // Automatically reset mock state between every test
  77. // resetMocks: false,
  78. // Reset the module registry before running each individual test
  79. // resetModules: false,
  80. // A path to a custom resolver
  81. // resolver: undefined,
  82. // Automatically restore mock state between every test
  83. // restoreMocks: false,
  84. // The root directory that Jest should scan for tests and modules within
  85. // rootDir: undefined,
  86. // A list of paths to directories that Jest should use to search for files in
  87. // roots: [
  88. // "<rootDir>"
  89. // ],
  90. // Allows you to use a custom runner instead of Jest's default test runner
  91. // runner: "jest-runner",
  92. // The paths to modules that run some code to configure or set up the testing environment before each test
  93. setupFiles: ["../../scripts/jest-env-setup.js"],
  94. // A list of paths to modules that run some code to configure or set up the testing framework before each test
  95. // setupFilesAfterEnv: [],
  96. // The number of seconds after which a test is considered as slow and reported as such in the results.
  97. // slowTestThreshold: 5,
  98. // A list of paths to snapshot serializer modules Jest should use for snapshot testing
  99. // snapshotSerializers: [],
  100. // The test environment that will be used for testing
  101. // testEnvironment: "jest-environment-node",
  102. testEnvironment: "jsdom",
  103. // Options that will be passed to the testEnvironment
  104. // testEnvironmentOptions: {},
  105. // Adds a location field to test results
  106. // testLocationInResults: false,
  107. // The glob patterns Jest uses to detect test files
  108. // testMatch: [
  109. // "**/__tests__/**/*.[jt]s?(x)",
  110. // "**/?(*.)+(spec|test).[tj]s?(x)"
  111. // ],
  112. // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
  113. // testPathIgnorePatterns: [
  114. // "/node_modules/"
  115. // ],
  116. // The regexp pattern or array of patterns that Jest uses to detect test files
  117. // testRegex: [],
  118. // This option allows the use of a custom results processor
  119. // testResultsProcessor: undefined,
  120. // This option allows use of a custom test runner
  121. // testRunner: "jest-circus/runner",
  122. // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
  123. // testURL: "http://localhost",
  124. // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
  125. // timers: "real",
  126. // A map from regular expressions to paths to transformers
  127. // transform: undefined,
  128. // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
  129. transformIgnorePatterns: ["node_modules\\/(?!\\.pnpm|@dage)"],
  130. // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
  131. // unmockedModulePathPatterns: undefined,
  132. // Indicates whether each individual test should be reported during the run
  133. // verbose: undefined,
  134. // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
  135. // watchPathIgnorePatterns: [],
  136. // Whether to use watchman for file crawling
  137. // watchman: true,
  138. };