-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
52 lines (40 loc) · 1.77 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { JestConfigWithTsJest } from 'ts-jest';
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const ignorePaths = [
'node_modules',
'<rootDir>/.git',
'<rootDir>/.yarn',
'<rootDir>/packages/react-datepicker-user-event-test-failure/dist',
'<rootDir>/packages/react-datepicker-user-event-test-failure-icons/dist',
'<rootDir>/packages/react-datepicker-user-event-test-failure-shared/dist',
'<rootDir>/packages/storybook/dist',
'<rootDir>/packages/react-datepicker-user-event-test-failure-react-17-tests',
];
const config: JestConfigWithTsJest = {
moduleNameMapper: {
"\\.(s?css|less)$": "identity-obj-proxy"
},
// Jest finds two package.json files for packages/react-datepicker-user-event-test-failure without this config option.
modulePathIgnorePatterns: ignorePaths,
// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',
// Custom resolver to deal with nanoid being imported as EsModule
resolver: `${__dirname}/test/resolver.js`,
roots: ['<rootDir>'],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['./test/setup.ts'],
// The test environment that will be used for testing
testEnvironment: 'jsdom',
// The regex pattern Jest uses to detect test files
// Default: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$'
testRegex: 'packages/[^/]+/src/.*[.]test[.][jt]sx?$',
testPathIgnorePatterns: ignorePaths,
testTimeout: 30000,
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: './tsconfig-jest.json' }],
'^.+\\.(js|jsx)$': ['babel-jest', { configFile: './babel.jest.js' }],
'^.+\\.svg$': 'jest-transformer-svg'
},
};
export default config;