@@ -317,14 +317,9 @@ describe('functions() modular', function () {
317317 } ) ;
318318
319319 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 } ) ;
326321 try {
327- await functions . httpsCallable ( fnName , { timeout : 1000 } ) ( { testTimeout : ' 3000' } ) ;
322+ await functionRunner ( { delay : 3000 } ) ;
328323 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
329324 } catch ( error ) {
330325 error . message . should . containEql ( 'DEADLINE' ) . containEql ( 'EXCEEDED' ) ;
@@ -697,15 +692,12 @@ describe('functions() modular', function () {
697692 } ) ;
698693
699694 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 } ) ;
706698
707699 try {
708- await httpsCallable ( functions , fnName , { timeout : 1000 } ) ( { testTimeout : ' 3000' } ) ;
700+ await functionRunner ( { delay : 3000 } ) ;
709701 return Promise . reject ( new Error ( 'Did not throw an Error.' ) ) ;
710702 } catch ( error ) {
711703 error . message . should . containEql ( 'DEADLINE' ) . containEql ( 'EXCEEDED' ) ;
0 commit comments