Skip to content

Commit 62512ba

Browse files
authored
Test fix: Add missing warning assertion (#27434)
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.
1 parent 5b56653 commit 62512ba

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packages/react-server-dom-turbopack/src/__tests__/ReactFlightDOMBrowser-test.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,22 @@ describe('ReactFlightDOMBrowser', () => {
612612
});
613613

614614
it('basic use(context)', async () => {
615-
const ContextA = React.createServerContext('ContextA', '');
616-
const ContextB = React.createServerContext('ContextB', 'B');
615+
let ContextA;
616+
let ContextB;
617+
expect(() => {
618+
ContextA = React.createServerContext('ContextA', '');
619+
ContextB = React.createServerContext('ContextB', 'B');
620+
}).toErrorDev(
621+
[
622+
'Server Context is deprecated and will soon be removed. ' +
623+
'It was never documented and we have found it not to be useful ' +
624+
'enough to warrant the downside it imposes on all apps.',
625+
'Server Context is deprecated and will soon be removed. ' +
626+
'It was never documented and we have found it not to be useful ' +
627+
'enough to warrant the downside it imposes on all apps.',
628+
],
629+
{withoutStack: true},
630+
);
617631

618632
function ServerComponent() {
619633
return use(ContextA) + use(ContextB);

0 commit comments

Comments
 (0)