-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (21 loc) · 836 Bytes
/
jest.config.js
File metadata and controls
28 lines (21 loc) · 836 Bytes
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
module.exports = {
// The root of your source code, typically /src
// `<rootDir>` is a token Jest substitutes
roots: ['<rootDir>/__tests__'],
testMatch: ['<rootDir>/__tests__/**/*.test.(ts|tsx)'],
// Use babel-jest to transform TS/JS so ESM deps (like nanoid) are transpiled for Jest
transform: {
'^.+\\.(ts|tsx|js|jsx)$': 'babel-jest',
},
// Transform ESM packages that Jest can't run directly
transformIgnorePatterns: ['<rootDir>/node_modules/(?!(yaml|nanoid)/)'],
// Module file extensions for importing
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'css'],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/src/mock/styleMock.js',
},
setupFilesAfterEnv: ['<rootDir>/__tests__/setup.js'],
silent: false,
verbose: false,
testEnvironment: 'jest-environment-jsdom',
};