Skip to content

Commit

Permalink
Prod errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Sep 18, 2023
1 parent 16ef404 commit e2963e3
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6488,11 +6488,15 @@ describe('ReactDOMFizzServer', () => {
});
});

expect(recoverableErrors).toEqual([
'server error',
'replay error',
'server error',
]);
expect(recoverableErrors).toEqual(
__DEV__
? ['server error', 'replay error', 'server error']
: [
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
],
);
expect(getVisibleChildren(container)).toEqual(
<div>
{'Hello'}
Expand Down Expand Up @@ -6642,10 +6646,17 @@ describe('ReactDOMFizzServer', () => {

expect(prerenderErrors).toEqual([]);
expect(ssrErrors).toEqual(['aborted', 'aborted']);
expect(recoverableErrors).toEqual([
'The server did not finish this Suspense boundary: aborted',
'The server did not finish this Suspense boundary: aborted',
]);
expect(recoverableErrors).toEqual(
__DEV__
? [
'The server did not finish this Suspense boundary: aborted',
'The server did not finish this Suspense boundary: aborted',
]
: [
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
],
);
});

// @gate enablePostpone
Expand Down Expand Up @@ -6808,10 +6819,17 @@ describe('ReactDOMFizzServer', () => {
'replay error',
'replay error',
]);
expect(recoverableErrors).toEqual([
expect(recoverableErrors).toEqual(
// It surfaced in two different suspense boundaries.
'The server did not finish this Suspense boundary: replay error',
'The server did not finish this Suspense boundary: replay error',
]);
__DEV__
? [
'The server did not finish this Suspense boundary: replay error',
'The server did not finish this Suspense boundary: replay error',
]
: [
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.',
],
);
});
});

0 comments on commit e2963e3

Please sign in to comment.