-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
38 lines (38 loc) · 1.18 KB
/
jest.config.js
File metadata and controls
38 lines (38 loc) · 1.18 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
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testPathIgnorePatterns: ['/node_modules/', '/.docusaurus/', '/build/'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-react',
'@babel/preset-typescript',
],
}],
},
moduleNameMapper: {
'^@site/(.*)$': '<rootDir>/$1',
'^@docusaurus/(.*)$': '<rootDir>/src/__mocks__/@docusaurus/$1',
'^@theme/(.*)$': '<rootDir>/src/__mocks__/@theme/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/__mocks__/fileMock.js',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
collectCoverage: true,
coverageReporters: ['json', 'lcov', 'text', 'clover'],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
],
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50
}
},
};