Skip to content

Commit f3cb59f

Browse files
linting
1 parent 5ec98ae commit f3cb59f

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

jest.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ module.exports = {
33
testEnvironment: 'jsdom',
44
setupFiles: ['<rootDir>/node_package/tests/jest.setup.js'],
55
// TODO: Remove this once we made RSCClientRoot compatible with React 19
6-
moduleNameMapper: process.env.USE_REACT_18 ? {
7-
'^react$': '<rootDir>/node_modules/react-18',
8-
'^react/(.*)$': '<rootDir>/node_modules/react-18/$1',
9-
'^react-dom$': '<rootDir>/node_modules/react-dom-18',
6+
moduleNameMapper: process.env.USE_REACT_18
7+
? {
8+
'^react$': '<rootDir>/node_modules/react-18',
9+
'^react/(.*)$': '<rootDir>/node_modules/react-18/$1',
10+
'^react-dom$': '<rootDir>/node_modules/react-dom-18',
1011
'^react-dom/(.*)$': '<rootDir>/node_modules/react-dom-18/$1',
1112
}
12-
: {},
13+
: {
14+
'react-server-dom-webpack/client': '<rootDir>/node_package/tests/emptyForTesting.js',
15+
},
1316
};

node_package/tests/RSCClientRoot.test.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
* @jest-environment jsdom
55
*/
66

7-
// TODO: Remove this once we made these tests compatible with React 19
8-
if (process.env.USE_REACT_18 !== 'true') {
9-
test.skip('Skipping RSC tests when not using React 18', () => {});
10-
return;
11-
}
12-
137
// Mock webpack require system for RSC
148
window.__webpack_require__ = jest.fn();
159
window.__webpack_chunk_load__ = jest.fn();
@@ -26,7 +20,8 @@ import RSCClientRoot, { resetRenderCache } from '../src/RSCClientRoot';
2620

2721
enableFetchMocks();
2822

29-
describe('RSCClientRoot', () => {
23+
// TODO: Remove this once we made these tests compatible with React 19
24+
(process.env.USE_REACT_18 ? describe : describe.skip)('RSCClientRoot', () => {
3025
beforeEach(() => {
3126
jest.clearAllMocks();
3227

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {};

node_package/tests/utils.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { enableFetchMocks } from 'jest-fetch-mock';
22

3-
import { Readable } from 'stream';
43
import { fetch } from '../src/utils';
54
import { createNodeReadableStream } from './testUtils';
65

0 commit comments

Comments
 (0)