-
Notifications
You must be signed in to change notification settings - Fork 10
/
jest.config.js
44 lines (43 loc) · 1.51 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
const createConfig = require('@marigold/jest-config');
module.exports = createConfig({
testTimeout: 30000,
collectCoverageFrom: [
'!**/config/**',
'!**/docs*/**',
'!**/icons/**',
'!**/themes/**',
'!**/packages/types/**',
'!**/*.stories.tsx',
'!**/theme-preset/**',
'!packages/components/src/_propTableTypes/**',
// needed for coverage not to break should be fixed soon
'!packages/components/src/Accordion/useAccordionItem.ts',
'!packages/components/src/Accordion/Accordion.tsx',
],
coverageThreshold: {
global: {
statements: 90,
branches: 80,
functions: 90,
lines: 90,
},
},
// needed 'modulePathIgnorePatterns' because without it throws errors according to: Haste module map
// It cannot be resolved, because there exists several different files, or packages,
// that provide a module for that particular name and platform. The platform is generic (no extension).
modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleNameMapper: {
'^@marigold/theme-(.+)$': [
'<rootDir>/themes/theme-$1/src',
'<rootDir>/packages/theme-$1',
],
'^@marigold/(.+)-config$': '<rootDir>/config/$1',
'^@marigold/(.+)$': '<rootDir>/packages/$1/src',
'^@marigold/(.*)$': '<rootDir>/dist/myscope/$1',
},
// Sadly, Jest is not compatible with prettier v3
// Let's format the files by hand after update for now
// by disabling prettier formatting completely
// https://github.com/jestjs/jest/issues/14305
prettierPath: null,
});