forked from adobe/storefront-search-as-you-type
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
29 lines (28 loc) · 962 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
27
28
29
const config = {
preset: "ts-jest",
testEnvironment: "jsdom",
roots: ["<rootDir>/src"],
clearMocks: true,
moduleFileExtensions: ["ts", "tsx", "js"],
setupFilesAfterEnv: [
"@testing-library/jest-dom/extend-expect",
"jest-styled-components",
],
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.svg$": "<rootDir>/src/test-utils/imageTransform.js",
},
moduleDirectories: ["<rootDir>/src", "node_modules"],
moduleNameMapper: {
"\\.css$": "identity-obj-proxy",
"^components(.*)$": "<rootDir>/src/components$1",
"^styles(.*)$": "<rootDir>/src/styles$1",
"^utils(.*)$": "<rootDir>/src/utils$1",
"^.+\\.svg$": "<rootDir>/src/test-utils/imageTransform.js",
// Add aliases here ---> "^alias(.*)$": "<rootDir>/src/alias-path$1", <---
},
globals: {
API_URL: "https://commerce.adobe.io/search/graphql",
},
};
module.exports = config;