forked from atomic-testing/atomic-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.base.js
More file actions
52 lines (49 loc) · 1.22 KB
/
jest.config.base.js
File metadata and controls
52 lines (49 loc) · 1.22 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
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const { lstatSync, readdirSync } = require('fs');
// get listing of packages in the mono repo
const basePath = path.resolve(__dirname, 'packages');
const packages = readdirSync(basePath).filter((name) => {
return lstatSync(path.join(basePath, name)).isDirectory();
});
// const tsJestConfig = [
// 'ts-jest',
// {
// tsconfig: '<rootDir>/tsconfig.test.json',
// },
// ];
module.exports = {
roots: ['<rootDir>/src', '<rootDir>/__tests__'],
transform: {
'^.+\\.ts$': '@swc/jest',
'^.+\\.tsx$': [
'@swc/jest',
{
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
},
testRegex: '(/__tests__/.*.(test|spec)).(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverage: false,
coveragePathIgnorePatterns: ['(tests/.*.mock).(jsx?|tsx?)$'],
verbose: true,
testTimeout: 30000,
moduleNameMapper: {
...packages.reduce(
(acc, name) => ({
...acc,
[`@atomic-testing/${name}(.*)$`]: `<rootDir>/packages/../../${name}/src/$1`,
}),
{},
),
},
globals: {
IS_REACT_ACT_ENVIRONMENT: true,
},
};