-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathjest.config.js
More file actions
42 lines (41 loc) · 1.21 KB
/
jest.config.js
File metadata and controls
42 lines (41 loc) · 1.21 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
39
40
41
42
/** @type {import('jest').Config} */
const path = require('path');
module.exports = {
clearMocks: true,
transform: {
'^.+\\.[jt]sx?$': ['@swc/jest'],
},
transformIgnorePatterns: ['/node_modules/(?!@openmrs|.+\\.pnp\\.[^\\/]+$)'],
moduleNameMapper: {
'\\.(s?css)$': 'identity-obj-proxy',
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
'^dexie$': require.resolve('dexie'),
'^lodash-es/(.*)$': 'lodash/$1',
'^@tools/(.*)$': path.resolve(__dirname, 'tools', '$1'),
'^@mocks/(.*)$': path.resolve(__dirname, '__mocks__', '$1'),
'^lodash-es$': 'lodash',
'^react-i18next$': path.resolve(__dirname, '__mocks__', 'react-i18next.js'),
},
collectCoverageFrom: [
'**/src/**/*.component.tsx',
'!**/node_modules/**',
'!**/vendor/**',
'!**/src/**/*.test.*',
'!**/src/declarations.d.ts',
'!**/e2e/**',
],
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
setupFilesAfterEnv: [path.resolve(__dirname, 'tools', 'setup-tests.ts')],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'http://localhost/',
},
testPathIgnorePatterns: [path.resolve(__dirname, 'e2e')],
};