Skip to content

Commit

Permalink
Fix ReactContextValidator-test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Dec 19, 2024
1 parent 0ecee36 commit cb98be7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react/src/__tests__/ReactContextValidator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('ReactContextValidator', () => {
' in ComponentInFooBarContext (at **)',
'Component uses the legacy contextTypes API which will soon be removed. ' +
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
' in ComponentInFooBarContext (at **)',
' in Component (at **)',
]);
expect(instance.childRef.current.context).toEqual({foo: 'abc'});
});
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('ReactContextValidator', () => {
' in Parent (at **)',
'Component uses the legacy contextTypes API which will soon be removed. ' +
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
' in Parent (at **)',
' in Component (at **)',
]);

expect(constructorContext).toEqual({foo: 'abc'});
Expand Down Expand Up @@ -278,12 +278,15 @@ describe('ReactContextValidator', () => {
' in ParentContextProvider (at **)',
'MiddleMissingContext uses the legacy childContextTypes API which will soon be removed. ' +
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
' in MiddleMissingContext (at **)\n' +
' in ParentContextProvider (at **)',
'MiddleMissingContext.childContextTypes is specified but there is no getChildContext() method on the instance. ' +
'You can either define getChildContext() on MiddleMissingContext or remove childContextTypes from it.\n' +
' in MiddleMissingContext (at **)\n' +
' in ParentContextProvider (at **)',
'ChildContextConsumer uses the legacy contextTypes API which will soon be removed. ' +
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
' in ChildContextConsumer (at **)\n' +
' in MiddleMissingContext (at **)\n' +
' in ParentContextProvider (at **)',
]);
Expand Down

0 comments on commit cb98be7

Please sign in to comment.