Skip to content

Commit a651c6c

Browse files
authored
Merge d170bfa into 440f406
2 parents 440f406 + d170bfa commit a651c6c

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

packages-exp/auth-exp/test/helpers/integration/helpers.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ export function getTestInstance(): Auth {
7070
}
7171

7272
export async function cleanUpTestInstance(auth: Auth): Promise<void> {
73+
await auth.signOut();
7374
await (auth as IntegrationTestAuth).cleanUp();
7475
}
75-
76-
export function initIntegrationTestContext(): Auth {
77-
const auth = getTestInstance();
78-
79-
afterEach(async () => {
80-
await auth.signOut();
81-
});
82-
83-
after(async () => {
84-
await cleanUpTestInstance(auth);
85-
});
86-
87-
return auth;
88-
}

packages-exp/auth-exp/test/integration/flows/anonymous.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,21 @@ import {
2727
updateEmail,
2828
updatePassword
2929
} from '@firebase/auth-exp/index.browser';
30-
import { OperationType } from '@firebase/auth-types-exp';
30+
import { Auth, OperationType } from '@firebase/auth-types-exp';
3131
import { FirebaseError } from '@firebase/util';
3232

3333
import {
34-
initIntegrationTestContext,
34+
cleanUpTestInstance,
35+
getTestInstance,
3536
randomEmail
3637
} from '../../helpers/integration/helpers';
3738

3839
use(chaiAsPromised);
3940

4041
describe('Integration test: anonymous auth', () => {
41-
const auth = initIntegrationTestContext();
42+
let auth: Auth;
43+
beforeEach(() => (auth = getTestInstance()));
44+
afterEach(() => cleanUpTestInstance(auth));
4245

4346
it('signs in anonymously', async () => {
4447
const userCred = await signInAnonymously(auth);

0 commit comments

Comments
 (0)