generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 42
/
jest.config.js
30 lines (28 loc) · 998 Bytes
/
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
/** @type {import('jest').Config} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
module.exports = {
clearMocks: true,
collectCoverageFrom: ['**/src/**/*.component.tsx', '!**/node_modules/**', '!**/src/declarations.d.ts', '!**/e2e/**'],
transform: {
'^.+\\.tsx?$': ['@swc/jest'],
},
transformIgnorePatterns: ['/node_modules/(?!@openmrs)'],
moduleNameMapper: {
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
'\\.(s?css)$': 'identity-obj-proxy',
'^lodash-es/(.*)$': 'lodash/$1',
'^lodash-es$': 'lodash',
'^dexie$': require.resolve('dexie'),
'^react-i18next$': path.resolve(__dirname, '__mocks__', 'react-i18next.js'),
},
setupFilesAfterEnv: ['<rootDir>/src/setup-tests.ts'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost/',
},
testPathIgnorePatterns: [
"/node_modules/",
"/e2e/" // Ignore the e2e directory containing Playwright tests
]
};