-
Notifications
You must be signed in to change notification settings - Fork 12
/
jest.config.ts
51 lines (51 loc) · 1.46 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export default {
clearMocks: true,
collectCoverage: true,
coveragePathIgnorePatterns: [
"/node_modules",
"src/routes/index.tsx",
"/e2e",
"src/core/cardano",
],
coverageDirectory: "coverage",
coverageProvider: "v8",
coverageReporters: ["clover", "json", "lcov", "text", "text-summary"],
coverageThreshold: {
global: {
statements: 80,
branches: 50,
functions: 50,
lines: 80,
},
},
moduleFileExtensions: [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node",
"yaml",
],
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/src/ui/__mocks__/fileMock.ts",
"\\.(css|scss)$": "<rootDir>/src/ui/__mocks__/styleMock.ts",
// Jest cannot import the browser version so we can map in the NodeJS version instead.
},
testEnvironment: "jsdom",
testMatch: ["**/src/**/?(*.)+(test).[tj]s?(x)"],
testPathIgnorePatterns: ["/node_modules/", "/credential-server-ui/"],
transformIgnorePatterns: [
"node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons|swiper|ssr-window|@aparajita/capacitor-biometric-auth)/)",
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest",
"\\.yaml$": "jest-transform-yaml",
},
setupFilesAfterEnv: ["jest-canvas-mock", "<rootDir>/src/setupTests.ts"],
setupFiles: ["<rootDir>/src/ui/__mocks__/swiper.tsx"]
};