forked from deriv-com/deriv-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
47 lines (43 loc) · 1.59 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
44
45
46
47
/** @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|@deriv-com/quill-ui|@deriv-com/auth-client)',
],
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',
'@deriv-com/quill-ui': 'node_modules/@deriv-com/quill-ui/dist/main.js',
'\\.(svg)$': '<rootDir>/src/__mocks__/file.mock.ts',
},
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'mjs', 'json'],
rootDir: '.',
roots: ['<rootDir>'],
modulePaths: ['<rootDir>'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
};