Skip to content

Commit 805037a

Browse files
committed
fixed test
1 parent 124e186 commit 805037a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/auth.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ describe('createSessionCookie()', () => {
7979

8080
await new Promise(resolve => setTimeout(() => resolve(auth.revokeRefreshTokens(uid2, env)), 1000));
8181

82-
// Check revocation is forced in emulator-mode and this should throw.
83-
await expect(auth.verifySessionCookie(sessionCookie, false, env)).rejects.toThrowError(
84-
new FirebaseAuthError(AuthClientErrorCode.SESSION_COOKIE_REVOKED)
85-
);
82+
await expect(auth.verifySessionCookie(sessionCookie, false, env)).resolves.toHaveProperty('uid', uid2);
8683

8784
await expect(auth.verifySessionCookie(sessionCookie, true, env)).rejects.toThrowError(
8885
new FirebaseAuthError(AuthClientErrorCode.SESSION_COOKIE_REVOKED)
@@ -166,10 +163,7 @@ describe('verifySessionCookie()', () => {
166163
expect(userRecord.uid).to.equal(uid);
167164
expect(userRecord.disabled).to.equal(true);
168165

169-
// If it is in emulator mode, a user-disabled error will be thrown.
170-
await expect(auth.verifySessionCookie(sessionCookie, false, env)).rejects.toThrowError(
171-
new FirebaseAuthError(AuthClientErrorCode.USER_DISABLED)
172-
);
166+
await expect(auth.verifySessionCookie(sessionCookie, false, env)).resolves.toHaveProperty('uid', uid);
173167

174168
await expect(auth.verifySessionCookie(sessionCookie, true, env)).rejects.toThrowError(
175169
new FirebaseAuthError(AuthClientErrorCode.USER_DISABLED)

0 commit comments

Comments
 (0)