forked from deriv-com/deriv-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
43 lines (40 loc) · 1.46 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
38
39
40
41
42
43
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!**/node_modules/**',
'!src/configs/**',
'!src/pages/**', // TODO: Fix the docusuarus module naming
'!src/theme/**', // TODO: Fix the docusuarus module naming
'!src/test-utils.tsx',
],
coverageDirectory: './coverage/',
coverageReporters: ['lcov'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(j|t)sx?$': [
'ts-jest',
{
diagnostics: false,
},
],
'^.+\\.mjs$': 'babel-jest',
},
transformIgnorePatterns: ['node_modules/(?!(@docusaurus|swiper|ssr-window|dom7)|@theme)'],
moduleNameMapper: {
'@theme/(.*)': '@docusaurus/theme-classic/src/theme/$1',
'@docusaurus/(ErrorBoundary|BrowserOnly|ComponentCreator|constants|ExecutionEnvironment|Head|Interpolate|isInternalUrl|Link|Noop|renderRoutes|router|Translate|use.*)':
'@docusaurus/core/lib/client/exports/$1',
'@generated/(.*)': '<rootDir>/.docusaurus/$1',
'@docusaurus/plugin-content-docs/client': '@docusaurus/plugin-content-docs/src/client/index.ts',
'@site/(.*)': '<rootDir>/$1',
'\\.(css|scss|sass|less)$': 'identity-obj-proxy',
'\\.(svg)$': '<rootDir>/src/__mocks__/file.mock.ts',
},
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'mjs', 'json'],
rootDir: '.',
roots: ['<rootDir>'],
modulePaths: ['<rootDir>'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
};