-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.webview.js
More file actions
41 lines (41 loc) · 1.21 KB
/
jest.config.webview.js
File metadata and controls
41 lines (41 loc) · 1.21 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: ['**/test/webview/**/?(*.)+(spec|test).[t]s?(x)'],
setupFilesAfterEnv: ['./scripts/setup-jest-webview.ts'],
testPathIgnorePatterns: [
'/node_modules/',
'/lib/',
'/extension/',
'/test/commands/',
'/test/views/',
'/test/services/'
],
// Don't force coverage collection from untested files
// collectCoverageFrom: [
// 'webview/src/**/*.{ts,tsx}',
// '!webview/src/**/*.d.ts',
// '!webview/src/main.tsx',
// '!webview/src/vite-env.d.ts'
// ],
moduleNameMapper: {
'^(.+)\\.js$': '$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.svg$': '<rootDir>/test/__mocks__/fileMock.js',
'^react$': '<rootDir>/webview/node_modules/react',
'^react-dom$': '<rootDir>/webview/node_modules/react-dom'
},
moduleDirectories: ['node_modules', 'webview/node_modules'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: './tsconfig.test.json'
}
]
},
reporters: ['default', ['jest-junit', { outputName: 'junit-webview-tests.xml' }]],
coverageReporters: ['lcov', 'text'],
resetMocks: true
};