Skip to content

Commit

Permalink
Add ReactDOMClient to ServerIntegrationBasic
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Jan 27, 2024
1 parent 233b65d commit bce758f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio
const TEXT_NODE_TYPE = 3;

let React;
let ReactDOM;
let ReactDOMClient;
let ReactDOMServer;
let ReactTestUtils;

function initModules() {
// Reset warning cache.
jest.resetModules();
React = require('react');
ReactDOM = require('react-dom');
ReactDOMClient = require('react-dom/client');
ReactDOMServer = require('react-dom/server');
ReactTestUtils = require('react-dom/test-utils');

// Make them available to the helpers.
return {
ReactDOM,
ReactDOMClient,
ReactDOMServer,
ReactTestUtils,
};
Expand Down Expand Up @@ -149,8 +149,10 @@ describe('ReactDOMServerIntegration', () => {
expect(await render([])).toBe(null);
expect(await render(false)).toBe(null);
expect(await render(true)).toBe(null);
expect(await render(undefined)).toBe(null);
expect(await render([[[false]], undefined])).toBe(null);

// hydrateRoot errors for undefined children.
expect(await render(undefined, 1)).toBe(null);
});
});
});

0 comments on commit bce758f

Please sign in to comment.