/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
export default {
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false,
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
"/node_modules/"
],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
"text",
"text-summary",
"html",
"lcov"
],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
// A preset that is used as a base for Jest's configuration
preset: "ts-jest/presets/default-esm",
// The root directory that Jest should scan for tests and modules within
rootDir: ".",
// A list of paths to directories that Jest should use to search for files in
roots: [
"<rootDir>/src",
"<rootDir>/__tests__"
],
// The test environment that will be used for testing
testEnvironment: "node",
// The glob patterns Jest uses to detect test files
testMatch: [
"**/__tests__/**/*.test.ts",
"**/?(*.)+(spec|test).ts"
],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
"/node_modules/"
],
// A map from regular expressions to paths to transformers
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.json"
}
]
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: [
"/node_modules/(?!(@modelcontextprotocol)/)"
],
// Indicates whether each individual test should be reported during the run
verbose: true,
// Whether to use watchman for file crawling
watchman: true,
// File extensions that will be treated as ESM
extensionsToTreatAsEsm: [".ts"]
};