Skip to content

Commit 3bc643e

Browse files
committed
fix test
1 parent 3d3706b commit 3bc643e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ describe('ReactFunctionComponent', () => {
116116
' in GrandParent (at **)',
117117
'Child uses the legacy contextTypes API which will soon be removed. ' +
118118
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
119+
(gate('enableOwnerStacks') ? '' : ' in Child (at **)\n') +
119120
' in Parent (at **)\n' +
120121
' in GrandParent (at **)',
121122
]);
@@ -254,8 +255,13 @@ describe('ReactFunctionComponent', () => {
254255
root.render(<Parent />);
255256
});
256257
assertConsoleErrorDev([
257-
'Parent uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead.',
258-
'Child uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead.',
258+
'Parent uses the legacy childContextTypes API which will soon be removed. ' +
259+
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
260+
' in Parent (at **)',
261+
'Child uses the legacy contextTypes API which will be removed soon. ' +
262+
'Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)\n' +
263+
' in Child (at **)\n' +
264+
' in Parent (at **)',
259265
]);
260266
expect(el.textContent).toBe('en');
261267
});

0 commit comments

Comments
 (0)