Last active
February 2, 2022 14:32
-
-
Save antoniel/7f6d0c74f71c152645cece48bf37b3ab to your computer and use it in GitHub Desktop.
jest.config.js
This file contains 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
// yarn add --dev jest @types/jest @swc/core @swc/jest | |
module.exports = { | |
testEnvironment: "jsdom", | |
// setupFilesAfterEnv: ["<rootDir>/src/tests/setupTests.js"], // Uncomment if you need to run setupTests.js | |
collectCoverage: true, | |
moduleDirectories: ["node_modules", "<rootDir>"], | |
collectCoverageFrom: [ | |
"**/*.{js,jsx,ts,tsx}", | |
"!**/*.d.ts", | |
"!**/node_modules/**", | |
"!**/coverage/**", | |
"!**/pages/**", | |
"!**/.next/**", | |
"!*.config.js", | |
"!**/shared/icons", | |
], | |
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"], | |
testPathIgnorePatterns: ["/node_modules/", "/coverage/"], | |
transform: { | |
"\\.[jt]sx?$": ["@swc-node/jest", {}], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment