nextui/jest.config.js

29 lines
788 B
JavaScript

module.exports = {
testEnvironment: "jsdom",
collectCoverageFrom: ["packages/**/*.{ts,tsx}"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
modulePathIgnorePatterns: ["<rootDir>/examples", "<rootDir>/tooling/cra-template*"],
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic",
},
},
},
},
],
},
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect", "./scripts/setup-test.ts"],
globals: {
"ts-jest": {
tsconfig: "tsconfig.json",
},
},
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
};