-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
jest.config.ts
35 lines (33 loc) · 922 Bytes
/
jest.config.ts
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
import type { Config } from 'jest'
import { defaults } from 'jest-config'
const config: Config = {
moduleDirectories: [
`node_modules`,
`src`,
],
moduleFileExtensions: [
...defaults.moduleFileExtensions,
`ts`,
`tsx`,
],
/* eslint-disable sort-keys-fix/sort-keys-fix */
moduleNameMapper: {
"^react$": `preact/compat`,
"^react-dom/test-utils$": `preact/test-utils`,
"^react-dom$": `preact/compat`,
"^react/jsx-runtime$": `preact/jsx-runtime`,
},
/* eslint-enable sort-keys-fix/sort-keys-fix */
testEnvironment: `jsdom`,
testPathIgnorePatterns: [
`<rootDir>/node_modules/`,
],
transform: {
"^.+\\.(tsx|jsx|js|ts|mjs)?$": `<rootDir>/node_modules/babel-jest`,
"^.+\\.svg$": `<rootDir>/tests/svgTransform.js`,
},
transformIgnorePatterns: [
`<rootDir>/node_modules/.pnpm/(?!(leven|@testing-library\\+preact|preact)@)`,
],
}
export default config