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