forked from pegasystems/constellation-ui-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
31 lines (30 loc) · 890 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
31
const packagesToTranspile = [
'@pega/cosmos-react-core',
'@pega/cosmos-react-social',
'@pega/cosmos-react-rte',
'@pega/cosmos-react-work',
'shortcuts',
'preact'
];
const packagesToTranspileStr = packagesToTranspile.map(p => `${p}`).join('|');
module.exports = {
preset: 'ts-jest',
verbose: true,
moduleNameMapper: {
shortcuts: '<rootDir>/node_modules/shortcuts/dist/index.js'
},
collectCoverageFrom: [
'src/components/**/*.{ts,tsx,js,jsx}',
'!**/*.(test|stories).{ts,tsx,js,jsx}'
],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
moduleDirectories: ['node_modules', 'src'],
setupFiles: ['./setupFiles.ts'],
setupFilesAfterEnv: ['./setupTests.ts'],
transformIgnorePatterns: [`node_modules/(?!(${packagesToTranspileStr}))`],
testEnvironment: 'jsdom',
transform: {
'\\.[jt]sx?$': 'babel-jest',
'^.+\\.(ts|tsx)?$': 'ts-jest'
}
};