-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathjest.config.js
More file actions
37 lines (37 loc) · 907 Bytes
/
jest.config.js
File metadata and controls
37 lines (37 loc) · 907 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
29
30
31
32
33
34
35
36
37
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'**/tests/**/*.test.[jt]s',
'**/?(*.)+(spec|test).[jt]s'
],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!tests/**',
'!src/extension.ts', // Extension entry point is hard to test
'!src/prompts/target/**', // Generated files
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
moduleNameMapper: {
// Handle VS Code module
'vscode': '<rootDir>/tests/__mocks__/vscode.ts'
},
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: 'tsconfig.test.json'
}]
},
testPathIgnorePatterns: [
'/node_modules/',
'/__mocks__/'
],
// 使快照文件更易读
snapshotFormat: {
escapeString: false,
printBasicPrototype: false
}
};