This repository was archived by the owner on May 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
31 lines (29 loc) · 1.4 KB
/
jest.config.js
File metadata and controls
31 lines (29 loc) · 1.4 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
import nextJest from 'next/jest.js';
/** @type {import('jest').Config} */
const jestConfig = {
displayName: 'docs',
testEnvironment: 'jsdom',
testMatch: ['**/*.test.(js|ts|tsx)'],
setupFilesAfterEnv: ['@testing-library/jest-dom/jest-globals'],
clearMocks: true,
moduleNameMapper: {
'^~/(.*)$': '<rootDir>/$1',
// note(simek): force Jest to use non ESM bundle
'^@radix-ui/react-dropdown-menu$':
'<rootDir>/node_modules/@radix-ui/react-dropdown-menu/dist/index.js',
'^@radix-ui/react-select$': '<rootDir>/node_modules/@radix-ui/react-select/dist/index.js',
'^framer-motion$': '<rootDir>/node_modules/framer-motion/dist/cjs/index.js',
'^@fingerprintjs/fingerprintjs-pro-react$':
'<rootDir>/node_modules/@fingerprintjs/fingerprintjs-pro-react/dist/fp-pro-react.cjs.js',
'^@sanity/client$': '<rootDir>/node_modules/@sanity/client/dist/index.cjs',
'^nanoid/index.browser.js$': '<rootDir>/node_modules/nanoid/index.browser.cjs',
'^nanoid$': '<rootDir>/node_modules/nanoid/index.cjs',
'^nanoid/non-secure$': '<rootDir>/node_modules/nanoid/non-secure/index.cjs',
// c15t (used by our cookie consent) bundles CSS modules that jsdom cannot parse
'^@expo/styleguide-cookie-consent$':
'<rootDir>/node_modules/@expo/styleguide-cookie-consent/mock.js',
},
transform: {},
extensionsToTreatAsEsm: ['.ts', '.tsx'],
};
export default nextJest({ dir: './' })(jestConfig);