-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
35 lines (28 loc) · 1.09 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
/**
* Jest Configuration.
* Source: https://jestjs.io/docs/en/configuration
*/
module.exports = {
// Tell Jest to stop running tests after first failure.
bail: false,
// use jsdom env
testEnvironment: "jsdom",
// coverage reports
collectCoverage: true,
collectCoverageFrom: ["src/**/*.js"],
coverageDirectory: "tests/coverage",
// A list of paths to modules that run some code to configure or set up the testing environment.
setupFiles: ["./tests/setupFiles.js"],
// Adding this config to accommodate for new TS files
// https://jestjs.io/docs/getting-started#using-typescript
transform: {
"^.+\\.[t|j]sx?$": "babel-jest",
},
transformIgnorePatterns: ["<rootDir>/node_modules/(?!(three|color-diff|@exabyte-io/cove.js)/)"],
// mock css files: https://jestjs.io/docs/en/webpack#handling-static-assets
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/tests/fileMock.js",
"\\.(css|sass|scss)$": "<rootDir>/tests/styleMock.js",
},
};