@@ -101,7 +101,9 @@ describe('pushNotificationSyncTask', () => {
101101 const foregroundCallback = jest . fn ( ) . mockResolvedValue ( undefined ) ;
102102 ( getPersistedConfig as jest . Mock ) . mockResolvedValue ( { debug : false } ) ;
103103 ( isSqliteCloudNotification as jest . Mock ) . mockReturnValue ( true ) ;
104- ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue ( foregroundCallback ) ;
104+ ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue (
105+ foregroundCallback
106+ ) ;
105107 ( AppState as any ) . currentState = 'active' ;
106108
107109 await handler ( {
@@ -117,7 +119,9 @@ describe('pushNotificationSyncTask', () => {
117119 const foregroundCallback = jest . fn ( ) . mockResolvedValue ( undefined ) ;
118120 ( getPersistedConfig as jest . Mock ) . mockResolvedValue ( { debug : false } ) ;
119121 ( isSqliteCloudNotification as jest . Mock ) . mockReturnValue ( true ) ;
120- ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue ( foregroundCallback ) ;
122+ ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue (
123+ foregroundCallback
124+ ) ;
121125 ( AppState as any ) . currentState = 'background' ;
122126
123127 await handler ( {
@@ -133,7 +137,9 @@ describe('pushNotificationSyncTask', () => {
133137 const foregroundCallback = jest . fn ( ) . mockResolvedValue ( undefined ) ;
134138 ( getPersistedConfig as jest . Mock ) . mockResolvedValue ( { debug : false } ) ;
135139 ( isSqliteCloudNotification as jest . Mock ) . mockReturnValue ( true ) ;
136- ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue ( foregroundCallback ) ;
140+ ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue (
141+ foregroundCallback
142+ ) ;
137143 ( AppState as any ) . currentState = 'inactive' ;
138144
139145 await handler ( {
@@ -146,7 +152,12 @@ describe('pushNotificationSyncTask', () => {
146152 } ) ;
147153
148154 it ( 'falls through to executeBackgroundSync when callback is null and app is backgrounded' , async ( ) => {
149- const fakeConfig = { debug : false , databaseId : 'db_id' , databaseName : 'test.db' , tablesToBeSynced : [ ] } ;
155+ const fakeConfig = {
156+ debug : false ,
157+ databaseId : 'db_id' ,
158+ databaseName : 'test.db' ,
159+ tablesToBeSynced : [ ] ,
160+ } ;
150161 ( getPersistedConfig as jest . Mock ) . mockResolvedValue ( fakeConfig ) ;
151162 ( isSqliteCloudNotification as jest . Mock ) . mockReturnValue ( true ) ;
152163 ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue ( null ) ;
@@ -166,7 +177,9 @@ describe('pushNotificationSyncTask', () => {
166177 . mockRejectedValue ( new Error ( 'sync failed' ) ) ;
167178 ( getPersistedConfig as jest . Mock ) . mockResolvedValue ( { debug : false } ) ;
168179 ( isSqliteCloudNotification as jest . Mock ) . mockReturnValue ( true ) ;
169- ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue ( foregroundCallback ) ;
180+ ( getForegroundSyncCallback as jest . Mock ) . mockReturnValue (
181+ foregroundCallback
182+ ) ;
170183
171184 await expect ( handler ( { data : { } , error : null } ) ) . resolves . toBeUndefined ( ) ;
172185 } ) ;
0 commit comments