-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.common.config.js
30 lines (30 loc) · 1.01 KB
/
jest.common.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
30
module.exports = {
moduleDirectories: ["node_modules", "<rootDir>"],
preset: "ts-jest",
setupFilesAfterEnv: ["./jest.setup.ts"],
testEnvironment: "jsdom",
/**
* A list of paths to directories that Jest should use to search for files in.
* The first two paths are the default paths that Jest uses to search for files.
* The third path specifies the namespace-test files that we want to exclude from the test run.
* The fourth path specifies the storybook files that we want to exclude from the test run.
*
* https://jestjs.io/docs/configuration#testmatch-arraystring
*/
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"!**/__tests__/**/*.namespace-test.[jt]s?(x)",
"!**/__storybook__/**/*",
],
transform: {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"../../fileTransformer.js",
"^.+\\.tsx?$": [
"ts-jest",
{
// ts-jest configuration goes here
},
],
},
};