-
Notifications
You must be signed in to change notification settings - Fork 127
/
jest.config.js
25 lines (24 loc) · 1.11 KB
/
jest.config.js
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
const path = require("path");
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig.json");
module.exports = {
roots: ["<rootDir>/src"],
testTimeout: 300000, // 5 minutes in milliseconds
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
verbose: true,
testEnvironment: "jsdom",
transform: {
"\\.(ts|tsx|js|jsx)$": ["ts-jest", { diagnostics: false }],
},
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/.erb/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: path.join("<rootDir>/", compilerOptions.baseUrl) }),
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json"],
moduleDirectories: ["node_modules", "release/app/node_modules"],
testPathIgnorePatterns: ["release/app/dist"],
setupFiles: ["./.erb/scripts/check-build-exists.ts"],
transformIgnorePatterns: ["node_modules/(?!is-ip|ip-regex|super-regex|function-timeout|time-span|convert-hrtime|is-regexp|clone-regexp)"],
};