@@ -19,19 +19,27 @@ import * as sinon from 'sinon';
19
19
import firebase from '@firebase/app-compat' ;
20
20
import '../..' ;
21
21
22
- import * as exp from '@firebase/auth/internal' ;
23
22
import {
24
23
getAppConfig ,
25
24
getEmulatorUrl
26
25
} from '../../../auth/test/helpers/integration/settings' ;
27
26
import { resetEmulator } from '../../../auth/test/helpers/integration/emulator_rest_helpers' ;
28
- export { createNewTenant } from '../../../auth/test/helpers/integration/emulator_rest_helpers' ;
27
+ export {
28
+ createNewTenant ,
29
+ getOobCodes ,
30
+ getPhoneVerificationCodes ,
31
+ OobCodeSession
32
+ } from '../../../auth/test/helpers/integration/emulator_rest_helpers' ;
33
+ export {
34
+ randomEmail ,
35
+ randomPhone
36
+ } from '../../../auth/test/helpers/integration/helpers' ;
29
37
30
38
export function initializeTestInstance ( ) : void {
31
39
firebase . initializeApp ( getAppConfig ( ) ) ;
32
- const stub = stubConsoleToSilenceEmulatorWarnings ( ) ;
33
- firebase . auth ( ) . useEmulator ( getEmulatorUrl ( ) ! ) ;
34
- stub . restore ( ) ;
40
+ firebase . auth ( ) . useEmulator ( getEmulatorUrl ( ) ! , {
41
+ disableWarnings : true
42
+ } ) ;
35
43
}
36
44
37
45
export async function cleanUpTestInstance ( ) : Promise < void > {
@@ -41,20 +49,3 @@ export async function cleanUpTestInstance(): Promise<void> {
41
49
}
42
50
await resetEmulator ( ) ;
43
51
}
44
-
45
- export function randomEmail ( ) : string {
46
- return `${ exp . _generateEventId ( 'test.email.' ) } @integration.test` ;
47
- }
48
-
49
- function stubConsoleToSilenceEmulatorWarnings ( ) : sinon . SinonStub {
50
- const originalConsoleInfo = console . info . bind ( console ) ;
51
- return sinon . stub ( console , 'info' ) . callsFake ( ( ...args : unknown [ ] ) => {
52
- if (
53
- ! JSON . stringify ( args [ 0 ] ) . includes (
54
- 'WARNING: You are using the Auth Emulator'
55
- )
56
- ) {
57
- originalConsoleInfo ( ...args ) ;
58
- }
59
- } ) ;
60
- }
0 commit comments