-
Notifications
You must be signed in to change notification settings - Fork 40
/
jest.config.js
44 lines (42 loc) · 1.36 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
/** @type {import('jest').Config} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
const config = {
verbose: true,
collectCoverage: true,
coverageThreshold: {
global: {
statements: 0,
branches: 0,
functions: 0,
lines: 0,
},
},
coverageReporters: ['json-summary', 'lcov'],
collectCoverageFrom: [
'**/src/**/*.component.tsx',
'!**/node_modules/**',
'!**/vendor/**',
'!**/src/**/*.test.*',
'!**/src/declarations.d.ts',
'!**/e2e/**',
],
transform: {
'^.+\\.(j|t)sx?$': '@swc/jest',
},
transformIgnorePatterns: ['/node_modules/(?!@openmrs)'],
moduleDirectories: ['node_modules', '__mocks__', 'tools', __dirname],
moduleNameMapper: {
'\\.(s?css)$': 'identity-obj-proxy',
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
'^@carbon/charts-react$': path.resolve(__dirname, '__mocks__', '@carbon__charts-react.ts'),
'^dexie$': require.resolve('dexie'),
'^lodash-es/(.*)$': 'lodash/$1',
'^lodash-es$': 'lodash',
'^react-i18next$': path.resolve(__dirname, '__mocks__', 'react-i18next.js'),
'^uuid$': path.resolve(__dirname, 'node_modules', 'uuid', 'dist', 'index.js'),
},
testEnvironment: 'jsdom',
testPathIgnorePatterns: [path.resolve(__dirname, 'node_modules'), path.resolve(__dirname, 'e2e')],
};
module.exports = config;