@@ -317,14 +317,9 @@ describe('functions() modular', function () {
317
317
} ) ;
318
318
319
319
it ( 'HttpsCallableOptions.timeout will error when timeout is exceeded' , async function ( ) {
320
- const fnName = 'invertaseReactNativeFirebaseFunctionsEmulator' ;
321
- const region = 'europe-west2' ;
322
-
323
- const functions = firebase . app ( ) . functions ( region ) ;
324
- functions . useFunctionsEmulator ( 'http://api.rnfirebase.io' ) ;
325
-
320
+ const functionRunner = firebase . functions ( ) . httpsCallable ( 'sleeper' , { timeout : 1000 } ) ;
326
321
try {
327
- await functions . httpsCallable ( fnName , { timeout : 1000 } ) ( { testTimeout : ' 3000' } ) ;
322
+ await functionRunner ( { delay : 3000 } ) ;
328
323
return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
329
324
} catch ( error ) {
330
325
error . message . should . containEql ( 'DEADLINE' ) . containEql ( 'EXCEEDED' ) ;
@@ -697,15 +692,12 @@ describe('functions() modular', function () {
697
692
} ) ;
698
693
699
694
it ( 'HttpsCallableOptions.timeout will error when timeout is exceeded' , async function ( ) {
700
- const { getFunctions, httpsCallable, connectFunctionsEmulator } = functionsModular ;
701
- const fnName = 'invertaseReactNativeFirebaseFunctionsEmulator' ;
702
- const region = 'europe-west2' ;
703
-
704
- const functions = getFunctions ( firebase . app ( ) , region ) ;
705
- connectFunctionsEmulator ( functions , 'api.rnfirebase.io' , 5001 ) ;
695
+ const { getFunctions, httpsCallable } = functionsModular ;
696
+ const functions = getFunctions ( firebase . app ( ) ) ;
697
+ const functionRunner = httpsCallable ( functions , 'sleeper' , { timeout : 1000 } ) ;
706
698
707
699
try {
708
- await httpsCallable ( functions , fnName , { timeout : 1000 } ) ( { testTimeout : ' 3000' } ) ;
700
+ await functionRunner ( { delay : 3000 } ) ;
709
701
return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
710
702
} catch ( error ) {
711
703
error . message . should . containEql ( 'DEADLINE' ) . containEql ( 'EXCEEDED' ) ;
0 commit comments