File tree 4 files changed +7
-6
lines changed
4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
import '@shopify/flash-list/jestSetup' ;
2
2
import 'react-native-gesture-handler/jestSetup' ;
3
+ import type * as RNKeyboardController from 'react-native-keyboard-controller' ;
3
4
import mockStorage from 'react-native-onyx/dist/storage/__mocks__' ;
4
5
import 'setimmediate' ;
5
6
import mockFSLibrary from './setupMockFullstoryLib' ;
@@ -54,5 +55,4 @@ jest.mock('react-native-share', () => ({
54
55
default : jest . fn ( ) ,
55
56
} ) ) ;
56
57
57
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
58
- jest . mock ( 'react-native-keyboard-controller' , ( ) => require ( 'react-native-keyboard-controller/jest' ) ) ;
58
+ jest . mock ( 'react-native-keyboard-controller' , ( ) => require < typeof RNKeyboardController > ( 'react-native-keyboard-controller/jest' ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default function mockFSLibrary() {
15
15
return {
16
16
FSPage ( ) : FSPageInterface {
17
17
return {
18
- start : jest . fn ( ) ,
18
+ start : jest . fn ( ( ) => { } ) ,
19
19
} ;
20
20
} ,
21
21
default : Fullstory ,
Original file line number Diff line number Diff line change
1
+ import type Permissions from '@libs/Permissions' ;
1
2
import CONST from '@src/CONST' ;
2
3
import type Beta from '@src/types/onyx/Beta' ;
3
4
@@ -9,7 +10,7 @@ import type Beta from '@src/types/onyx/Beta';
9
10
*/
10
11
11
12
export default {
12
- ...jest . requireActual ( '../Permissions' ) ,
13
+ ...jest . requireActual < typeof Permissions > ( '../Permissions' ) ,
13
14
canUseDefaultRooms : ( betas : Beta [ ] ) => betas . includes ( CONST . BETAS . DEFAULT_ROOMS ) ,
14
15
canUseViolations : ( betas : Beta [ ] ) => betas . includes ( CONST . BETAS . VIOLATIONS ) ,
15
16
} ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
5
5
import type { OnyxUpdatesFromServer } from '@src/types/onyx' ;
6
6
import createProxyForObject from '@src/utils/createProxyForObject' ;
7
7
8
- const AppImplementation : typeof AppImport = jest . requireActual ( '@libs/actions/App' ) ;
8
+ const AppImplementation = jest . requireActual < typeof AppImport > ( '@libs/actions/App' ) ;
9
9
const {
10
10
setLocale,
11
11
setLocaleAndNavigate,
@@ -40,7 +40,7 @@ const mockValues: AppMockValues = {
40
40
} ;
41
41
const mockValuesProxy = createProxyForObject ( mockValues ) ;
42
42
43
- const ApplyUpdatesImplementation : typeof ApplyUpdatesImport = jest . requireActual ( '@libs/actions/OnyxUpdateManager/utils/applyUpdates' ) ;
43
+ const ApplyUpdatesImplementation = jest . requireActual < typeof ApplyUpdatesImport > ( '@libs/actions/OnyxUpdateManager/utils/applyUpdates' ) ;
44
44
const getMissingOnyxUpdates = jest . fn ( ( _fromID : number , toID : number ) => {
45
45
if ( mockValuesProxy . missingOnyxUpdatesToBeApplied === undefined ) {
46
46
return Onyx . set ( ONYXKEYS . ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT , toID ) ;
You can’t perform that action at this time.
0 commit comments