forked from react-pdf-viewer/react-pdf-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
27 lines (25 loc) · 1.09 KB
/
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
import { type Config } from 'jest';
const config: Config = {
moduleNameMapper: {
'@react-pdf-viewer/core': '<rootDir>/packages/core/src',
'@react-pdf-viewer/default-layout': '<rootDir>/packages/default-layout/src',
// In order to load the PDF document in node, we use the ES5 build
// For pdfjs-dist 2.7.570+
'pdfjs-dist': '<rootDir>/node_modules/pdfjs-dist/legacy/build/pdf',
// For pdfjs-dist 2.6.347
// 'pdfjs-dist': '<rootDir>/node_modules/pdfjs-dist/es5/build/pdf',
// Polyfill `Path2D` required by pdfjs
'path2d-polyfill': '<rootDir>/node_modules/path2d-polyfill',
},
setupFilesAfterEnv: ['<rootDir>/__setups__/setupTests.ts'],
testEnvironment: 'jsdom',
// Uncomment the `testMatch` option when we want to run a specific test case
// testMatch: ['<rootDir>/packages/thumbnail/__tests__/coverWidth.test.tsx'],
testRegex: ['(/__tests__/.*|(\\.|/)(test|spec))\\.tsx$'],
testTimeout: 20 * 1000, // 20s
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
verbose: true,
};
export default config;