module.exports = { // Use a big timeout for CI. testTimeout: 20_000, maxWorkers: 8, projects: [ { displayName: "test", roots: [""], setupFilesAfterEnv: ["./jest.setup.ts"], extensionsToTreatAsEsm: [".ts"], transform: { "^.+\\.(t|j)sx?$": [ "@swc/jest", { jsc: { transform: { react: { runtime: "automatic", }, }, experimental: { plugins: [["jest_workaround", {}]], }, }, }, ], }, testEnvironment: "jsdom", testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", testPathIgnorePatterns: ["/node_modules/", "/e2e/"], transformIgnorePatterns: [ "/node_modules/@chartjs-adapter-date-fns", ], moduleDirectories: ["node_modules", "/src"], moduleNameMapper: { "\\.css$": "/src/testHelpers/styleMock.ts", }, }, { displayName: "lint", runner: "jest-runner-eslint", testMatch: [ "/**/*.js", "/**/*.ts", "/**/*.tsx", ], testPathIgnorePatterns: [ "/out/", "/_jest/", "jest.config.js", "jest-runner.*.js", ], }, ], collectCoverageFrom: [ // included files "/**/*.ts", "/**/*.tsx", // excluded files "!/**/*.stories.tsx", "!/_jest/**/*.*", "!/api.ts", "!/coverage/**/*.*", "!/e2e/**/*.*", "!/jest-runner.eslint.config.js", "!/jest.config.js", "!/out/**/*.*", "!/storybook-static/**/*.*", ], }