2019-12-22 14:05:15 +00:00
|
|
|
module.exports = {
|
2022-03-27 23:23:32 +00:00
|
|
|
// Automatically clear mock calls and instances between every test
|
2021-03-13 23:44:01 +00:00
|
|
|
clearMocks: true,
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// An array of file extensions your modules use
|
2021-03-13 23:44:01 +00:00
|
|
|
moduleFileExtensions: ['js', 'ts'],
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// The test environment that will be used for testing
|
2019-12-22 14:05:15 +00:00
|
|
|
testEnvironment: 'node',
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// The glob patterns Jest uses to detect test files
|
2021-03-13 23:44:01 +00:00
|
|
|
testMatch: ['**/*.test.ts'],
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// This option allows use of a custom test runner
|
2021-03-13 23:44:01 +00:00
|
|
|
testRunner: 'jest-circus/runner',
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// A map with regular expressions for transformers to paths
|
2021-03-13 23:44:01 +00:00
|
|
|
transform: {
|
|
|
|
'^.+\\.ts$': 'ts-jest',
|
|
|
|
},
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// Indicates whether each individual test should be reported during the run
|
2021-03-13 23:44:01 +00:00
|
|
|
verbose: true,
|
2022-03-27 23:23:32 +00:00
|
|
|
|
|
|
|
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
|
|
modulePathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/dist/'],
|
|
|
|
|
2025-08-06 05:07:52 +00:00
|
|
|
// Files that will be run before Jest is loaded to set globals like fetch
|
|
|
|
setupFiles: ['<rootDir>/src/jest.globals.ts'],
|
|
|
|
// A list of paths to modules that run some code to configure or set up the testing framework after the environment is ready
|
2022-03-27 23:23:32 +00:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
|
2019-12-22 14:05:15 +00:00
|
|
|
};
|