Skip to content

Commit aa60489

Browse files
authored
Merge a36363e into d44fc4c
2 parents d44fc4c + a36363e commit aa60489

File tree

7 files changed

+849
-50
lines changed

7 files changed

+849
-50
lines changed

packages/auth-compat/test/helpers/helpers.ts

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,27 @@ import * as sinon from 'sinon';
1919
import firebase from '@firebase/app-compat';
2020
import '../..';
2121

22-
import * as exp from '@firebase/auth/internal';
2322
import {
2423
getAppConfig,
2524
getEmulatorUrl
2625
} from '../../../auth/test/helpers/integration/settings';
2726
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';
2937

3038
export function initializeTestInstance(): void {
3139
firebase.initializeApp(getAppConfig());
32-
const stub = stubConsoleToSilenceEmulatorWarnings();
33-
firebase.auth().useEmulator(getEmulatorUrl()!);
34-
stub.restore();
40+
firebase.auth().useEmulator(getEmulatorUrl()!, {
41+
disableWarnings: true
42+
});
3543
}
3644

3745
export async function cleanUpTestInstance(): Promise<void> {
@@ -41,20 +49,3 @@ export async function cleanUpTestInstance(): Promise<void> {
4149
}
4250
await resetEmulator();
4351
}
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

Comments
 (0)