File tree Expand file tree Collapse file tree 4 files changed +35
-26
lines changed Expand file tree Collapse file tree 4 files changed +35
-26
lines changed Original file line number Diff line number Diff line change 1
- jest . mock ( './src/RNGestureHandlerModule' ) ;
1
+ jest . mock ( './src/RNGestureHandlerModule' , ( ) => require ( './src/mocks' ) ) ;
2
+ jest . mock ( './lib/commonjs/RNGestureHandlerModule' , ( ) =>
3
+ require ( './lib/commonjs/mocks' )
4
+ ) ;
5
+ jest . mock ( './lib/module/RNGestureHandlerModule' , ( ) =>
6
+ require ( './lib/module/mocks' )
7
+ ) ;
Original file line number Diff line number Diff line change 1
- import { View , ScrollView } from 'react-native' ;
2
-
3
- const NOOP = ( ) => {
4
- // do nothing
5
- } ;
1
+ import Mocks from '../mocks' ;
6
2
7
3
export default {
8
- ScrollView,
9
- PanGestureHandler : View ,
10
- attachGestureHandler : NOOP ,
11
- createGestureHandler : NOOP ,
12
- dropGestureHandler : NOOP ,
13
- updateGestureHandler : NOOP ,
14
- Direction : {
15
- RIGHT : 1 ,
16
- LEFT : 2 ,
17
- UP : 4 ,
18
- DOWN : 8 ,
19
- } ,
20
- State : {
21
- BEGAN : 'BEGAN' ,
22
- FAILED : 'FAILED' ,
23
- ACTIVE : 'ACTIVE' ,
24
- END : 'END' ,
25
- UNDETERMINED : 'UNDETERMINED' ,
26
- } ,
4
+ ...Mocks ,
27
5
} ;
Original file line number Diff line number Diff line change
1
+ import { View , ScrollView as RNScrollView } from 'react-native' ;
2
+ import { State } from './State' ;
3
+ import { Directions } from './Directions' ;
4
+
5
+ const NOOP = ( ) => {
6
+ // do nothing
7
+ } ;
8
+ const ScrollView = RNScrollView ;
9
+ const PanGestureHandler = View ;
10
+ const attachGestureHandler = NOOP ;
11
+ const createGestureHandler = NOOP ;
12
+ const dropGestureHandler = NOOP ;
13
+ const updateGestureHandler = NOOP ;
14
+
15
+ export default {
16
+ ScrollView,
17
+ PanGestureHandler,
18
+ attachGestureHandler,
19
+ createGestureHandler,
20
+ dropGestureHandler,
21
+ updateGestureHandler,
22
+ // probably can be removed
23
+ Directions,
24
+ State,
25
+ } as const ;
Original file line number Diff line number Diff line change 18
18
"noUnusedParameters" : true ,
19
19
"noUnusedLocals" : true
20
20
},
21
- "include" : [" src/**/*.ts" , " src/**/*.tsx" ]
21
+ "include" : [" src/**/*.ts" , " src/**/*.tsx" , " jestSetup.js " ]
22
22
}
You can’t perform that action at this time.
0 commit comments