-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
37 lines (37 loc) · 1.17 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
35
36
37
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
globalSetup: '<rootDir>/src/jest/globalSetup.ts',
setupFiles: ['<rootDir>/src/jest/setupFiles.ts'],
setupFilesAfterEnv: ['<rootDir>/src/jest/setupFilesAfterEnv.ts'],
globalTeardown: '<rootDir>/src/jest/globalTeardown.ts',
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.test.json',
},
],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/src/jest/fileMock.ts',
'@docusaurus/Link': '<rootDir>/src/jest/LinkMock.tsx',
'@docusaurus/useDocusaurusContext':
'<rootDir>/src/jest/useDocusaurusContextMock.ts',
'@docusaurus/useBaseUrl': '<rootDir>/src/jest/useBaseUrlMock.ts',
},
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/**/*.{ts,tsx}',
'!<rootDir>/src/**/*.{test,spec}.{ts,tsx}',
],
coverageReporters: [
'text',
['text', { file: 'details.txt' }],
['text-summary', { file: 'summary.txt' }],
],
testRegex: '/src/.+(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
silent: true,
};