File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import navigationRef from '@libs/Navigation/navigationRef';
55import type { getPathFromState as GetPathFromState } from '@react-navigation/native' ;
66
77jest . mock ( '@react-navigation/native' , ( ) => {
8- const actual = jest . requireActual ( '@react-navigation/native' ) as Record < string , unknown > ;
8+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
9+ const actual = jest . requireActual ( '@react-navigation/native' ) as { getPathFromState : typeof GetPathFromState } ;
910 return {
1011 ...actual ,
1112 getPathFromState : jest . fn < typeof GetPathFromState > ( ( ) => '/settings/profile?backTo=settings' ) ,
@@ -20,6 +21,7 @@ describe('Navigation', () => {
2021 beforeEach ( ( ) => {
2122 // Minimal stubs so getActiveRoute() can derive a path without rendering navigation containers.
2223 const ref = navigationRef as typeof navigationRef & { current : { getCurrentRoute : ( ) => { name : string } } | null } ;
24+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2325 ref . current = { getCurrentRoute : jest . fn ( ) . mockReturnValue ( { name : 'test' } ) } as any ;
2426 jest . spyOn ( navigationRef , 'getRootState' ) . mockReturnValue ( { } as unknown as ReturnType < typeof navigationRef . getRootState > ) ;
2527 jest . spyOn ( navigationRef , 'isReady' ) . mockReturnValue ( true ) ;
You can’t perform that action at this time.
0 commit comments