diff --git a/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js b/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js
index e8e7dffee5d6d..2df65af1ba697 100644
--- a/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js
@@ -11,7 +11,6 @@ let React;
let ReactDOMClient;
let ReactDOMServer;
let act;
-let usingPartialRenderer;
const util = require('util');
const realConsoleError = console.error;
@@ -26,8 +25,6 @@ describe('ReactDOMServerHydration', () => {
ReactDOMServer = require('react-dom/server');
act = require('react-dom/test-utils').act;
- usingPartialRenderer = global.__WWW__ && !__EXPERIMENTAL__;
-
console.error = jest.fn();
container = document.createElement('div');
document.body.appendChild(container);
@@ -731,15 +728,13 @@ describe('ReactDOMServerHydration', () => {
);
}
- // @TODO FB bundles use a different renderer that does not serialize errors to the client
- const mismatchEl = usingPartialRenderer ? '
' : '';
// @TODO changes made to sending Fizz errors to client led to the insertion of templates in client rendered
// suspense boundaries. This leaks in this test becuase the client rendered suspense boundary appears like
// unhydrated tail nodes and this template is the first match. When we add special case handling for client
// rendered suspense boundaries this test will likely change again
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
Array [
- "Warning: Did not expect server HTML to contain a ${mismatchEl} in .
+ "Warning: Did not expect server HTML to contain a
in .
in div (at **)
in Mismatch (at **)",
"Warning: An error occurred during hydration. The server HTML was replaced with client content in
.",
@@ -819,21 +814,11 @@ describe('ReactDOMServerHydration', () => {
);
}
- // We gate this assertion becuase fb-classic uses PartialRenderer for renderToString and it does not
- // serialize server errors and send to client
- if (usingPartialRenderer) {
- expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
- Array [
- "Caught [The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.]",
- ]
- `);
- } else {
- expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
- Array [
- "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
- ]
- `);
- }
+ expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
+ Array [
+ "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
+ ]
+ `);
});
// @gate __DEV__
@@ -854,21 +839,11 @@ describe('ReactDOMServerHydration', () => {
);
}
- // We gate this assertion becuase fb-classic uses PartialRenderer for renderToString and it does not
- // serialize server errors and send to client
- if (usingPartialRenderer) {
- expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
- Array [
- "Caught [The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.]",
- ]
- `);
- } else {
- expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
- Array [
- "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
- ]
- `);
- }
+ expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
+ Array [
+ "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
+ ]
+ `);
});
});