-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathjest.config.ts
More file actions
51 lines (41 loc) · 1.62 KB
/
jest.config.ts
File metadata and controls
51 lines (41 loc) · 1.62 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import type { Config } from 'jest'
const config: Config = {
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',
// A set of global variables that need to be available in all test environments
globals: {
'ts-jest': {
isolatedModules: true,
},
},
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'^lodash-es$': 'lodash',
'^@logicflow/core$': '<rootDir>/packages/core/src/index.ts',
'^@logicflow/extension$': '<rootDir>/packages/extension/src/index.ts',
},
// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
// The test environment that will be used for testing
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
'/node_modules/',
'/es/',
'/lib/',
'/examples/vue3-app/',
],
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: ['/node_modules/'],
}
export default config