Skip to content

Commit

Permalink
Test fix: Add missing warning assertion (#27434)
Browse files Browse the repository at this point in the history
Adds a missing test assertion for Server Context deprecation.

The PR that added this warning was based on an older revision than the
PR that added the test.
  • Loading branch information
acdlite authored Sep 28, 2023
1 parent 5b56653 commit 62512ba
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,22 @@ describe('ReactFlightDOMBrowser', () => {
});

it('basic use(context)', async () => {
const ContextA = React.createServerContext('ContextA', '');
const ContextB = React.createServerContext('ContextB', 'B');
let ContextA;
let ContextB;
expect(() => {
ContextA = React.createServerContext('ContextA', '');
ContextB = React.createServerContext('ContextB', 'B');
}).toErrorDev(
[
'Server Context is deprecated and will soon be removed. ' +
'It was never documented and we have found it not to be useful ' +
'enough to warrant the downside it imposes on all apps.',
'Server Context is deprecated and will soon be removed. ' +
'It was never documented and we have found it not to be useful ' +
'enough to warrant the downside it imposes on all apps.',
],
{withoutStack: true},
);

function ServerComponent() {
return use(ContextA) + use(ContextB);
Expand Down

0 comments on commit 62512ba

Please sign in to comment.