From 0cb68f4469a3027a5c5c3f0273118ca2f7f6bad3 Mon Sep 17 00:00:00 2001 From: alina sireneva Date: Thu, 9 May 2024 02:13:55 +0300 Subject: [PATCH] test(e2e): better SESSION_PASSWORD_NEEDED handling (yet again) --- e2e/deno/tests/01.auth.ts | 3 +++ e2e/node/ts/tests/01.auth.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/e2e/deno/tests/01.auth.ts b/e2e/deno/tests/01.auth.ts index 0f5a6be0..6a0188e6 100644 --- a/e2e/deno/tests/01.auth.ts +++ b/e2e/deno/tests/01.auth.ts @@ -34,6 +34,9 @@ Deno.test('1. authorization', { sanitizeResources: false }, async (t) => { tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') ) { // retry with another number + await tg.logOut().catch((err) => { + console.error('Failed to log out:', err) + }) continue } else { await tg.close() diff --git a/e2e/node/ts/tests/01.auth.ts b/e2e/node/ts/tests/01.auth.ts index e5367888..3b5acac8 100644 --- a/e2e/node/ts/tests/01.auth.ts +++ b/e2e/node/ts/tests/01.auth.ts @@ -37,6 +37,9 @@ describe('1. authorization', function () { tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') ) { // retry with another number + await tg.logOut().catch((err) => { + console.error('Failed to log out:', err) + }) continue } else { await tg.close()