Skip to content

Commit 717caa2

Browse files
committed
Fix lint
1 parent 0971bea commit 717caa2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/navigation/isActiveRouteTests.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import navigationRef from '@libs/Navigation/navigationRef';
44
import type {Route} from '@src/ROUTES';
55

66
jest.mock('@react-navigation/native', () => {
7-
const actual = jest.requireActual('@react-navigation/native');
8-
return Object.assign({}, actual, {
7+
const actual = jest.requireActual('@react-navigation/native') as typeof import('@react-navigation/native');
8+
return {
9+
...actual,
910
getPathFromState: jest.fn().mockReturnValue('/settings/profile?backTo=settings'),
10-
});
11+
};
1112
});
1213

1314
describe('Navigation', () => {
@@ -17,10 +18,9 @@ describe('Navigation', () => {
1718

1819
beforeEach(() => {
1920
// Minimal stubs so getActiveRoute() can derive a path without rendering navigation containers.
20-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21-
(navigationRef as any).getRootState = jest.fn().mockReturnValue({});
22-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
23-
(navigationRef as any).current = {getCurrentRoute: jest.fn().mockReturnValue({name: 'DUMMY'})};
21+
const ref = navigationRef as typeof navigationRef & {current: {getCurrentRoute: () => {name: string}} | null};
22+
ref.current = {getCurrentRoute: jest.fn().mockReturnValue({name: 'test'})};
23+
jest.spyOn(navigationRef, 'getRootState').mockReturnValue({} as unknown as ReturnType<typeof navigationRef.getRootState>);
2424
jest.spyOn(navigationRef, 'isReady').mockReturnValue(true);
2525
});
2626

0 commit comments

Comments
 (0)