@@ -323,26 +323,6 @@ test('does not warn when only valid options are passed', async () => {
323323 expect ( _console . warn ) . not . toHaveBeenCalled ( ) ;
324324} ) ;
325325
326- test ( 'warns for unknown options but still passes valid options to render' , async ( ) => {
327- const Context = React . createContext ( 'default' ) ;
328-
329- function useTestHook ( ) {
330- return React . useContext ( Context ) ;
331- }
332-
333- function Wrapper ( { children } : { children : ReactNode } ) {
334- return < Context . Provider value = "provided" > { children } </ Context . Provider > ;
335- }
336-
337- const { result } = await renderHook ( useTestHook , {
338- wrapper : Wrapper ,
339- unknownOption : 'value' ,
340- } as any ) ;
341-
342- expect ( _console . warn ) . toHaveBeenCalledTimes ( 1 ) ;
343- expect ( result . current ) . toEqual ( 'provided' ) ;
344- } ) ;
345-
346326test ( 'warns when unknown option is passed' , async ( ) => {
347327 function useTestHook ( ) {
348328 return React . useState ( 0 ) ;
@@ -355,16 +335,3 @@ test('warns when unknown option is passed', async () => {
355335 'Unknown option(s) passed to renderHook: unknownOption' ,
356336 ) ;
357337} ) ;
358-
359- test ( 'warns when multiple unknown options are passed' , async ( ) => {
360- function useTestHook ( ) {
361- return React . useState ( 0 ) ;
362- }
363-
364- await renderHook ( useTestHook , { unknown1 : 'value1' , unknown2 : 'value2' } as any ) ;
365-
366- expect ( _console . warn ) . toHaveBeenCalledTimes ( 1 ) ;
367- expect ( jest . mocked ( _console . warn ) . mock . calls [ 0 ] [ 0 ] ) . toContain (
368- 'Unknown option(s) passed to renderHook: unknown1, unknown2' ,
369- ) ;
370- } ) ;
0 commit comments