Skip to content

Commit

Permalink
Update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 27, 2024
1 parent 7a07e98 commit 0928d91
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ describe('ReactDOMConsoleErrorReporting', () => {

if (__DEV__) {
expect(console.error.mock.calls).toEqual([
[expect.stringContaining('ReactDOM.render is no longer supported')],
[
expect.stringContaining(
'ReactDOM.render has not been supported since React 18',
),
],
]);
} else {
expect(console.error).not.toBeCalled();
Expand Down Expand Up @@ -163,7 +167,11 @@ describe('ReactDOMConsoleErrorReporting', () => {
]);

expect(console.error.mock.calls).toEqual([
[expect.stringContaining('ReactDOM.render is no longer supported')],
[
expect.stringContaining(
'ReactDOM.render has not been supported since React 18',
),
],
]);
} else {
expect(console.warn).not.toBeCalled();
Expand Down Expand Up @@ -308,7 +316,11 @@ describe('ReactDOMConsoleErrorReporting', () => {
]);

expect(console.error.mock.calls).toEqual([
[expect.stringContaining('ReactDOM.render is no longer supported')],
[
expect.stringContaining(
'ReactDOM.render has not been supported since React 18',
),
],
]);
} else {
expect(console.warn).not.toBeCalled();
Expand Down Expand Up @@ -455,7 +467,11 @@ describe('ReactDOMConsoleErrorReporting', () => {
]);

expect(console.error.mock.calls).toEqual([
[expect.stringContaining('ReactDOM.render is no longer supported')],
[
expect.stringContaining(
'ReactDOM.render has not been supported since React 18',
),
],
]);
} else {
expect(console.warn).not.toBeCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe('ReactDOMServerPartialHydration', () => {
'Component',
'Component',
// Hydration mismatch is logged
'Hydration failed because the server rendered HTML didn\'t match the client.',
"Hydration failed because the server rendered HTML didn't match the client.",
'There was an error while hydrating this Suspense boundary.',
]);

Expand Down Expand Up @@ -1162,7 +1162,7 @@ describe('ReactDOMServerPartialHydration', () => {
});

assertLog([
'Hydration failed because the server rendered HTML didn\'t match the client.',
"Hydration failed because the server rendered HTML didn't match the client.",
'There was an error while hydrating this Suspense boundary.',
]);

Expand Down

0 comments on commit 0928d91

Please sign in to comment.