Skip to content

Commit e58df2b

Browse files
author
Sebastian Silbermann
committed
Make toErrorDev assertion agnostic to test matrix
1 parent c7afadd commit e58df2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/react-dom/src/__tests__/ReactDOMOption-test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('ReactDOMOption', () => {
1313
let React;
1414
let ReactDOMClient;
1515
let ReactDOMServer;
16+
let ReactFeatureFlags;
1617
let ReactTestUtils;
1718
let act;
1819

@@ -21,6 +22,7 @@ describe('ReactDOMOption', () => {
2122
React = require('react');
2223
ReactDOMClient = require('react-dom/client');
2324
ReactDOMServer = require('react-dom/server');
25+
ReactFeatureFlags = require('shared/ReactFeatureFlags');
2426
ReactTestUtils = require('react-dom/test-utils');
2527
act = require('internal-test-utils').act;
2628
});
@@ -255,15 +257,15 @@ describe('ReactDOMOption', () => {
255257

256258
await expect(async () => {
257259
await act(async () => {
258-
ReactDOMClient.hydrateRoot(container, children);
260+
ReactDOMClient.hydrateRoot(container, children, {
261+
onRecoverableError: () => {},
262+
});
259263
});
260264
}).toErrorDev(
261265
[
262266
'Warning: Text content did not match. Server: "FooBaz" Client: "Foo"',
263267
'Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>',
264268
'Warning: validateDOMNesting(...): <div> cannot appear as a child of <option>',
265-
'Error: Text content does not match server-rendered HTML.',
266-
'Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.',
267269
],
268270
{withoutStack: 1},
269271
);

0 commit comments

Comments
 (0)