|
1 | 1 | const path = require("path"); |
| 2 | +const { TextEncoder, TextDecoder } = require("util"); |
| 3 | + |
| 4 | +global.TextEncoder = TextEncoder; |
| 5 | +global.TextDecoder = TextDecoder; |
2 | 6 |
|
3 | 7 | module.exports = { |
4 | 8 | rootDir: ".", |
5 | | - testMatch: [ |
6 | | - "<rootDir>/tests/frontend/**/*.test.js" |
7 | | - ], |
8 | | - testPathIgnorePatterns: [ |
9 | | - "/node_modules/", |
10 | | - "/dist/" |
11 | | - ], |
| 9 | + testMatch: ["<rootDir>/tests/frontend/**/*.test.js"], |
| 10 | + testPathIgnorePatterns: ["/node_modules/", "/dist/"], |
12 | 11 | moduleNameMapper: { |
13 | 12 | "\\.(css|less|scss|sass)$": "identity-obj-proxy", |
14 | | - "^@src/(.*)$": "<rootDir>/frontend/src/$1" |
| 13 | + "^@src/(.*)$": "<rootDir>/frontend/src/$1", |
15 | 14 | }, |
16 | | - setupFilesAfterEnv: [ |
17 | | - "@testing-library/jest-dom" |
18 | | - ], |
19 | | - moduleDirectories: [ |
20 | | - "node_modules", |
21 | | - path.resolve(__dirname, "node_modules") |
22 | | - ], |
| 15 | + setupFilesAfterEnv: ["@testing-library/jest-dom"], |
| 16 | + moduleDirectories: ["node_modules", path.resolve(__dirname, "node_modules")], |
23 | 17 | transform: { |
24 | | - "^.+\\.[jt]sx?$": "babel-jest" |
| 18 | + "^.+\\.[jt]sx?$": "babel-jest", |
25 | 19 | }, |
26 | 20 | transformIgnorePatterns: [ |
27 | | - "/node_modules/(?!(react-monaco-editor|monaco-editor)/)" |
| 21 | + "/node_modules/(?!(react-monaco-editor|monaco-editor)/)", |
28 | 22 | ], |
29 | | - testEnvironment: "jsdom" |
| 23 | + testEnvironment: "jsdom", |
| 24 | + setupFilesAfterEnv: ["<rootDir>/jest.setup.js"], |
30 | 25 | }; |
0 commit comments