-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
34 lines (30 loc) · 1 KB
/
jest.config.js
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
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.ts$': ['ts-jest', {
// Your ts-jest configuration goes here
// Example:
tsconfig: './tsconfig.json'
}]
},
// Handling ESM modules in node_modules
transformIgnorePatterns: [
'node_modules/(?!(inquirer)/)',
'examples/(?!()/)',
'example/packages/(?!()/)',
'!src/for-tests/node_modules/', // Include the path to your specific folder here.
],
testMatch: [
"<rootDir>/__tests__/**/*.(test|spec).(ts|tsx|js|jsx)",
"<rootDir>/example/__tests__/**/*.(test|spec).(ts|tsx|js|jsx)"
],
// Mocks for certain packages can be provided, especially if they are causing issues in the testing environment.
moduleNameMapper: {
// Use this section to specify mocks for certain node_modules, if necessary.
},
silent: false,
// ... rest of your jest config.
}