Skip to content

Commit

Permalink
Make toErrorDev assertion agnostic to test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Silbermann committed Jan 19, 2024
1 parent c7afadd commit e58df2b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-dom/src/__tests__/ReactDOMOption-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('ReactDOMOption', () => {
let React;
let ReactDOMClient;
let ReactDOMServer;
let ReactFeatureFlags;
let ReactTestUtils;
let act;

Expand All @@ -21,6 +22,7 @@ describe('ReactDOMOption', () => {
React = require('react');
ReactDOMClient = require('react-dom/client');
ReactDOMServer = require('react-dom/server');
ReactFeatureFlags = require('shared/ReactFeatureFlags');
ReactTestUtils = require('react-dom/test-utils');
act = require('internal-test-utils').act;
});
Expand Down Expand Up @@ -255,15 +257,15 @@ describe('ReactDOMOption', () => {

await expect(async () => {
await act(async () => {
ReactDOMClient.hydrateRoot(container, children);
ReactDOMClient.hydrateRoot(container, children, {
onRecoverableError: () => {},
});
});
}).toErrorDev(
[
'Warning: Text content did not match. Server: "FooBaz" Client: "Foo"',
'Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>',
'Warning: validateDOMNesting(...): <div> cannot appear as a child of <option>',
'Error: Text content does not match server-rendered HTML.',
'Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.',
],
{withoutStack: 1},
);
Expand Down

0 comments on commit e58df2b

Please sign in to comment.