-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
20 lines (20 loc) · 871 Bytes
/
Copy pathjest.config.js
File metadata and controls
20 lines (20 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
testEnvironmentOptions: {
// jsdom test environment uses "browser" by default. This causes jest to
// import the "browser" export from package.json. Preact (and probably other
// modules) link to ESM modules from the "browser" export, and this fails
// because jest doesn't support ESM modules by default (and doesn't
// transpile stuff in node_modules by default).
// See: https://jestjs.io/docs/configuration#testenvironmentoptions-object
customExportConditions: ["node", "node-addons"],
},
maxWorkers: 1,
testPathIgnorePatterns: ["/node_modules/", ".mock."],
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
transform: {
"\\.svg$": "<rootDir>/jest-webpack-asset-source-transformer",
},
};