-
Notifications
You must be signed in to change notification settings - Fork 111
/
jest.config.js
81 lines (80 loc) · 2.07 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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const esModules = [
"bail",
"ccount",
"comma-separated-tokens",
"data-uri-to-buffer",
"decode-named-character-reference",
"devlop",
"escape-string-regexp",
"estree-util-is-identifier-name",
"fetch-blob",
"formdata-polyfill",
"hast-util-from-parse5",
"hast-util-parse-selector",
"hast-util-raw",
"hast-util-to-jsx-runtime",
"hast-util-to-parse5",
"hast-util-whitespace",
"hastscript",
"html-url-attributes",
"html-void-elements",
"is-plain-obj",
"longest-streak",
"markdown-table",
"mdast-util-definitions",
"mdast-util-find-and-replace",
"mdast-util-from-markdown",
"mdast-util-gfm",
"mdast-util-phrasing",
"mdast-util-to-hast",
"mdast-util-to-markdown",
"mdast-util-to-string",
"micromark",
"node-fetch",
"property-information",
"react-markdown",
"react-syntax-highlighter",
"rehype-raw",
"remark-gfm",
"remark-parse",
"remark-rehype",
"space-separated-tokens",
"thememirror",
"trim-lines",
"trough",
"unified",
"unist-util-generated",
"unist-util-is",
"unist-util-position",
"unist-util-stringify-position",
"unist-util-visit",
"uri-transformer",
"vfile",
"vfile-message",
"web-namespaces",
"zwitch",
].join("|");
module.exports = {
setupFiles: ["<rootDir>/src/__tests__/__setup__/setup.js"],
modulePaths: ["<rootDir>/src"],
moduleFileExtensions: ["js", "mjs", "jsx", "tsx"],
testEnvironment: "./jsdom-env.js",
testTimeout: 10000,
transform: {
"^.+\\.[jt]sx?$": "babel-jest",
},
globals: {
fetch: global.fetch,
},
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
testMatch: ["**/__tests__/**/*.test.js"],
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|md)$":
"<rootDir>/src/__tests__/__setup__/fileMock.js",
"\\.(css|less)$": "<rootDir>/src/__tests__/__setup__/fileMock.js",
},
coveragePathIgnorePatterns: ["<rootDir>/src/__tests__/__setup__/"],
testPathIgnorePatterns: ["<rootDir>/src/__tests__/__setup__/"],
collectCoverage: true,
collectCoverageFrom: ["src/**/*.{js,jsx}"],
};