Skip to content

Commit c1e4484

Browse files
committed
fixed test cases to handle async signin
1 parent e64e63c commit c1e4484

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

packages/auth/src/mfa/assertions/totp.test.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,9 @@ describe('Testing signin Flow', () => {
268268
'123456'
269269
) as any;
270270

271-
try {
272-
_response = await assertion._process(auth, session);
273-
} catch (e) {
274-
expect(e).to.be.an.instanceOf(FirebaseError);
275-
expect(e.message).to.eql('Firebase: Error (auth/argument-error).');
276-
}
271+
await expect(assertion._process(auth, session)).to.be.rejectedWith(
272+
'auth/argument-error'
273+
);
277274
});
278275

279276
it('should throw Firebase Error if otp is undefined', async () => {
@@ -288,12 +285,9 @@ describe('Testing signin Flow', () => {
288285
undefined as any
289286
) as any;
290287

291-
try {
292-
_response = await assertion._process(auth, session);
293-
} catch (e) {
294-
expect(e).to.be.an.instanceOf(FirebaseError);
295-
expect(e.message).to.eql('Firebase: Error (auth/argument-error).');
296-
}
288+
await expect(assertion._process(auth, session)).to.be.rejectedWith(
289+
'auth/argument-error'
290+
);
297291
});
298292
});
299293

0 commit comments

Comments
 (0)