forked from Sage/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
37 lines (34 loc) · 1.12 KB
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Config } from "jest";
import coverageThresholds from "./coverage-thresholds.json";
const isCI = process.env.CI === "true";
const config: Config = {
notify: false,
setupFiles: ["raf/polyfill", "<rootDir>/enzyme.config.js"],
testEnvironment: "jsdom",
setupFilesAfterEnv: [
"<rootDir>/src/__spec_helper__/__internal__/index.ts",
"<rootDir>/src/__spec_helper__/__internal__/expect.ts",
"jest-canvas-mock",
],
snapshotSerializers: ["enzyme-to-json/serializer"],
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
testPathIgnorePatterns: ["node_modules", "lib", "esm"],
moduleDirectories: ["src", "node_modules"],
collectCoverage: true,
coveragePathIgnorePatterns: [
"node_modules",
"src/__spec_helper__",
"src/locales",
"lib",
"esm",
],
coverageReporters: ["text-summary", "html"],
coverageDirectory: "<rootDir>/coverage",
coverageThreshold: isCI ? undefined : coverageThresholds,
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "mjs"],
transform: {
"^.+\\.(js|mjs|jsx|ts|tsx)$": "babel-jest",
"^.+\\.svg$": "<rootDir>/svgTransform.mjs",
},
};
export default config;