@@ -27,6 +27,10 @@ import * as platform from './platform';
27
27
28
28
use ( sinonChai ) ;
29
29
30
+ function delay ( ms : number ) : Promise < void > {
31
+ return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
32
+ }
33
+
30
34
// For the most part, the auth methods just call straight through. Some parts
31
35
// of the auth compat layer are more complicated: these tests cover those
32
36
describe ( 'auth compat' , ( ) => {
@@ -102,6 +106,7 @@ describe('auth compat', () => {
102
106
) ;
103
107
// eslint-disable-next-line @typescript-eslint/no-floating-promises
104
108
await authCompat . signInWithRedirect ( new exp . GoogleAuthProvider ( ) ) ;
109
+ await delay ( 50 ) ;
105
110
expect ( setItemSpy ) . not . to . have . been . calledWith (
106
111
'firebase:persistence:api-key:undefined' ,
107
112
'TEST'
@@ -133,7 +138,7 @@ describe('auth compat', () => {
133
138
}
134
139
} ) ;
135
140
136
- it ( 'does not die if sessionStorage errors' , ( ) => {
141
+ it ( 'does not die if sessionStorage errors' , async ( ) => {
137
142
if ( typeof self !== 'undefined' ) {
138
143
sinon . stub ( platform , '_getSelfWindow' ) . returns ( {
139
144
get sessionStorage ( ) : Storage {
@@ -148,6 +153,7 @@ describe('auth compat', () => {
148
153
providerStub . initialize . returns ( underlyingAuth ) ;
149
154
new Auth ( app , providerStub as unknown as Provider < 'auth' > ) ;
150
155
// eslint-disable-next-line @typescript-eslint/no-floating-promises
156
+ await delay ( 50 ) ;
151
157
expect ( providerStub . initialize ) . to . have . been . calledWith ( {
152
158
options : {
153
159
popupRedirectResolver : CompatPopupRedirectResolver ,
0 commit comments