Files
iNaturalistReactNative/__mocks__/@react-navigation/native.ts
Ryan Stelly b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00

24 lines
687 B
TypeScript

// 20240806 amanda - best practice for react navigation
// is actually not to mock navigation at all. I removed
// useFocusEffect so we can test how that actually works in
// components; it requires using the wrapInNavigationContainer
// helper around components with useFocusEffect
// https://reactnavigation.org/docs/testing/#best-practices
const actualNav = jest.requireActual( "@react-navigation/native" );
const useRoute = jest.fn( ( ) => ( { params: {} } ) );
const useNavigation = ( ) => ( {
addListener: jest.fn( ),
canGoBack: jest.fn( ( ) => true ),
goBack: jest.fn( ),
setOptions: jest.fn( ),
} );
module.exports = {
...actualNav,
useNavigation,
useRoute,
};