Skip to content

Commit ee53e2b

Browse files
committed
Update Jest test config to remove legacy setup
1 parent 7a41c33 commit ee53e2b

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

.babelrc.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ module.exports = {
2424
['@babel/plugin-proposal-private-methods', { loose: true }],
2525
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
2626
cjs && ['@babel/transform-modules-commonjs'],
27-
[
28-
'@babel/transform-runtime',
29-
{
30-
useESModules: !cjs,
31-
version: require('./package.json').dependencies[
32-
'@babel/runtime'
33-
].replace(/^[^0-9]*/, ''),
34-
},
35-
],
3627
].filter(Boolean),
3728
assumptions: {
3829
enumerableModuleMeta: true,

jest.config.js

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ const defaults = {
66
testURL: 'http://localhost',
77
}
88

9+
process.env.TS_JEST_DISABLE_VER_CHECKER = true
10+
911
const NORMAL_TEST_FOLDERS = ['components', 'hooks', 'integration', 'utils']
1012

1113
const tsTestFolderPath = (folderName) =>
1214
`<rootDir>/test/${folderName}/**/*.{ts,tsx}`
1315

1416
const tsStandardConfig = {
1517
...defaults,
16-
displayName: 'ReactDOM 18 (Shim)',
18+
displayName: 'ReactDOM 18',
1719
preset: 'ts-jest',
1820
testMatch: NORMAL_TEST_FOLDERS.map(tsTestFolderPath),
1921
}
@@ -29,30 +31,6 @@ const rnConfig = {
2931
},
3032
}
3133

32-
const standardReact17Config = {
33-
...tsStandardConfig,
34-
displayName: 'ReactDOM 17',
35-
moduleNameMapper: {
36-
'^react$': 'react-17',
37-
'^react-dom$': 'react-dom-17',
38-
'^react-test-renderer$': 'react-test-renderer-17',
39-
'^@testing-library/react$': '@testing-library/react-12',
40-
},
41-
}
42-
43-
const nextEntryConfig = {
44-
...tsStandardConfig,
45-
displayName: 'ReactDOM 18 (Next)',
46-
moduleNameMapper: {
47-
'../../src/index': '<rootDir>/src/next',
48-
},
49-
}
50-
5134
module.exports = {
52-
projects: [
53-
tsStandardConfig,
54-
rnConfig,
55-
standardReact17Config,
56-
nextEntryConfig,
57-
],
35+
projects: [tsStandardConfig, rnConfig],
5836
}

0 commit comments

Comments
 (0)