Created
May 27, 2025 17:20
-
-
Save manuartero/e09a9a8ee16958490f5ae9036ad85acf to your computer and use it in GitHub Desktop.
jest.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* For a detailed explanation regarding each configuration property, visit: | |
* https://jestjs.io/docs/configuration | |
*/ | |
/** @type {import('jest').Config} */ | |
const config = { | |
clearMocks: true, | |
collectCoverage: true, | |
collectCoverageFrom: ["src/**"], | |
coverageDirectory: "coverage", | |
coverageProvider: "v8", | |
moduleDirectories: ["node_modules", "src"], // @see https://stackoverflow.com/a/51174924/1614677 | |
preset: "ts-jest", | |
resetMocks: true, | |
restoreMocks: true, | |
roots: ["<rootDir>/src"], | |
testEnvironment: "jsdom", | |
testMatch: ["**/?(*.)+(spec|test).[tj]s?(x)"], | |
transform: { | |
"^.+\\.(js|ts|tsx)$": "ts-jest", | |
"^.+.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": | |
"jest-transform-stub", | |
}, | |
}; | |
export default config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment