forked from researchdata-sheffield/dataviz-hub2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
38 lines (33 loc) · 1.3 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
module.exports = {
preset: "jest-playwright-preset",
cacheDirectory: ".jest-cache",
// transform js/jsx files using jest-preprocess.js file
transform: {
"^.+\\.jsx?$": `<rootDir>/tests/jest-preprocess.js`
},
// handling mocking static file imports
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/__mocks__/file-mock.js`
},
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test|e2e).[jt]s?(x)"
],
// ignore these files when testing
testPathIgnorePatterns: ["node_modules", "\\.cache", "<rootDir>.*/public"],
// IMPORTANT: because Gatsby includes un-transpiled ES6 code
// And it will try to transform files within Gatsby-name folders under node_modules
// gatsby-browser-entry.js isn’t being transpiled before running in Jest
transformIgnorePatterns: ["node_modules/(?!(gatsby)/)"],
globals: {
__PATH_PREFIX__: ""
},
testURL: "http://localhost:9000",
// files will be included before all tests are run
setupFiles: ["<rootDir>/tests/loadershim.js"],
setupFilesAfterEnv: ["<rootDir>/tests/setupAfterEnv.js", "expect-playwright"],
testTimeout: 60000,
collectCoverage: true,
coverageReporters: ["text", "html"]
};