generated from timelessco/react-components-template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.config.js
26 lines (25 loc) · 924 Bytes
/
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
26
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
const { join } = require("path");
const pkg = require("./package.json");
// eslint-disable-next-line import/no-anonymous-default-export
module.exports = {
rootDir: __dirname,
displayName: pkg.name,
testEnvironment: "jsdom",
testMatch: [join(__dirname, "src/**/*.test.{js,ts,tsx}")],
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/src/__mocks__/fileMock.js",
"\\.(css|less|sass|scss)$": "<rootDir>/src/__mocks__/styleMock.js",
"^@shared(.*)$": "<rootDir>/shared$1",
},
coveragePathIgnorePatterns: ["node_modules", "__mocks__", "stories"],
clearMocks: true,
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
};