-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
33 lines (32 loc) · 1.16 KB
/
jest.config.js
File metadata and controls
33 lines (32 loc) · 1.16 KB
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
module.exports = {
roots: ["app/javascript"],
testRegex: ".*test.(t|j)sx?$",
testEnvironment: "jsdom",
collectCoverageFrom: [
"app/javascript/**/*.{js,ts,tsx}",
"!app/javascript/entrypoints/*",
"!app/javascript/**/*.d.ts",
"!app/javascript/const/**/*",
],
transform: {
// eslint-disable-next-line @typescript-eslint/no-require-imports
"^.+\\.(t|j)sx?$": ["@swc/jest", require("./config/swc.config.js").options],
},
coverageThreshold: {
"app/javascript/**/*.{js,ts,tsx}": {
branches: 100,
functions: 100,
lines: 100,
},
},
setupFilesAfterEnv: ["./app/javascript/jest.setup.ts"],
moduleFileExtensions: ["js", "ts", "json", "tsx", "scss"],
moduleNameMapper: {
"\\.(css|less|scss)$": "identity-obj-proxy",
// These are all the static file formats that shakapacker comes preconfigured with support for:
// https://github.com/shakacode/shakapacker/blob/64aee9530877f16f671bc21cf4c2eb1ec1047960/package/rules/file.js
"\\.(bmp|gif|jpe?g|png|tiff|ico|avif|webp|eot|otf|ttf|woff|woff2|svg)":
"<rootDir>/app/javascript/__mocks__/staticFileMock.js",
"~/(.*)$": "<rootDir>/app/javascript/$1",
},
}