forked from marmelab/react-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
43 lines (41 loc) · 1.08 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
const path = require('path');
const fs = require('fs');
const packages = fs.readdirSync(path.resolve(__dirname, './packages'));
const moduleNameMapper = packages.reduce((mapper, dirName) => {
const pkg = require(path.resolve(
__dirname,
'./packages',
dirName,
'package.json'
));
mapper[`^${pkg.name}(.*)$`] = path.join(
__dirname,
`./packages/${dirName}/src$1`
);
return mapper;
}, {});
module.exports = {
globalSetup: './test-global-setup.js',
setupFilesAfterEnv: ['./test-setup.js'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: [
'/node_modules/',
'/lib/',
'/esm/',
'/examples/simple/',
],
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\](?!(@hookform)/).+\\.(js|jsx|mjs|ts|tsx)$',
],
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
'^.+\\.[tj]sx?$': [
'ts-jest',
{
isolatedModules: true,
useESM: true,
},
],
},
moduleNameMapper,
};