forked from marmelab/react-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
38 lines (36 loc) · 955 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
32
33
34
35
36
37
38
const path = require('path');
const fs = require('fs');
const packages = fs.readdirSync(path.resolve(__dirname, './packages'));
const moduleNameMapper = packages.reduce((mapper, dirName) => {
const package = require(path.resolve(
__dirname,
'./packages',
dirName,
'package.json'
));
mapper[`^${package.name}(.*)$`] = path.join(
__dirname,
`./packages/${dirName}/src$1`
);
return mapper;
}, {});
module.exports = {
globalSetup: './test-global-setup.js',
setupFilesAfterEnv: ['./test-setup.js'],
preset: 'ts-jest/presets/js-with-ts',
testPathIgnorePatterns: [
'/node_modules/',
'/lib/',
'/esm/',
'/examples/simple/',
],
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$',
],
globals: {
'ts-jest': {
isolatedModules: true,
},
},
moduleNameMapper,
};