-
Notifications
You must be signed in to change notification settings - Fork 85
/
jest.config.ts
35 lines (32 loc) · 1003 Bytes
/
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
import { Config } from "jest";
import coverageThresholds from "./coverage-thresholds.json";
const isCI = process.env.CI === "true";
const config: Config = {
notify: false,
setupFiles: ["raf/polyfill"],
testEnvironment: "jsdom",
setupFilesAfterEnv: [
"<rootDir>/src/__spec_helper__/__internal__/index.ts",
"jest-canvas-mock",
],
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;