test(e2e): better SESSION_PASSWORD_NEEDED handling (yet again)

This commit is contained in:
alina 🌸 2024-05-09 02:13:55 +03:00
parent 8e9e759008
commit 0cb68f4469
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 6 additions and 0 deletions

View file

@ -34,6 +34,9 @@ Deno.test('1. authorization', { sanitizeResources: false }, async (t) => {
tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED')
) { ) {
// retry with another number // retry with another number
await tg.logOut().catch((err) => {
console.error('Failed to log out:', err)
})
continue continue
} else { } else {
await tg.close() await tg.close()

View file

@ -37,6 +37,9 @@ describe('1. authorization', function () {
tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED')
) { ) {
// retry with another number // retry with another number
await tg.logOut().catch((err) => {
console.error('Failed to log out:', err)
})
continue continue
} else { } else {
await tg.close() await tg.close()