File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed
packages-exp/auth-exp/test Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -70,19 +70,6 @@ export function getTestInstance(): Auth {
70
70
}
71
71
72
72
export async function cleanUpTestInstance ( auth : Auth ) : Promise < void > {
73
+ await auth . signOut ( ) ;
73
74
await ( auth as IntegrationTestAuth ) . cleanUp ( ) ;
74
75
}
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
- }
Original file line number Diff line number Diff line change @@ -27,18 +27,21 @@ import {
27
27
updateEmail ,
28
28
updatePassword
29
29
} from '@firebase/auth-exp/index.browser' ;
30
- import { OperationType } from '@firebase/auth-types-exp' ;
30
+ import { Auth , OperationType } from '@firebase/auth-types-exp' ;
31
31
import { FirebaseError } from '@firebase/util' ;
32
32
33
33
import {
34
- initIntegrationTestContext ,
34
+ cleanUpTestInstance ,
35
+ getTestInstance ,
35
36
randomEmail
36
37
} from '../../helpers/integration/helpers' ;
37
38
38
39
use ( chaiAsPromised ) ;
39
40
40
41
describe ( 'Integration test: anonymous auth' , ( ) => {
41
- const auth = initIntegrationTestContext ( ) ;
42
+ let auth : Auth ;
43
+ beforeEach ( ( ) => ( auth = getTestInstance ( ) ) ) ;
44
+ afterEach ( ( ) => cleanUpTestInstance ( auth ) ) ;
42
45
43
46
it ( 'signs in anonymously' , async ( ) => {
44
47
const userCred = await signInAnonymously ( auth ) ;
You can’t perform that action at this time.
0 commit comments