@@ -29,58 +29,6 @@ declare global {
2929 }
3030}
3131
32- type AnimatedTiming = (
33- value : Animated . Value | Animated . ValueXY ,
34- config : Animated . TimingAnimationConfig
35- ) => Animated . CompositeAnimation ;
36-
37- type AnimatedParallel = ( animations : Array < Animated . CompositeAnimation > ) => {
38- start : ( callback ?: Animated . EndCallback ) => void ;
39- } ;
40-
41- // Make sure any animation finishes before checking the snapshot results
42- jest . mock ( 'react-native' , ( ) => {
43- const RN = jest . requireActual ( 'react-native' ) ;
44-
45- const timing : AnimatedTiming = ( value , config ) => ( {
46- start : ( callback ) => {
47- value . setValue ( config . toValue as any ) ;
48- callback ?.( { finished : true } ) ;
49- } ,
50- value,
51- config,
52- stop : ( ) => {
53- throw new Error ( 'Not implemented' ) ;
54- } ,
55- reset : ( ) => {
56- throw new Error ( 'Not implemented' ) ;
57- } ,
58- } ) ;
59- RN . Animated . timing = timing ;
60-
61- const parallel : AnimatedParallel = ( animations ) => ( {
62- start : ( callback ) => {
63- const results = animations . map ( ( animation ) => {
64- animation . start ( ) ;
65- return { finished : true } ;
66- } ) ;
67- callback ?.( { finished : results . every ( ( result ) => result . finished ) } ) ;
68- } ,
69- } ) ;
70-
71- RN . Animated . parallel = parallel ;
72-
73- RN . Dimensions . get = ( ) => ( {
74- fontScale : 1 ,
75- } ) ;
76-
77- return RN ;
78- } ) ;
79-
80- jest . mock ( 'react-native-safe-area-context' , ( ) => ( {
81- useSafeAreaInsets : ( ) => ( { bottom : 0 , left : 0 , right : 0 , top : 0 } ) ,
82- } ) ) ;
83-
8432const icons = [ 'magnify' , 'camera' , 'inbox' , 'heart' , 'shopping-music' ] ;
8533
8634const createState = ( index : number , length : number ) => ( {
0 commit comments