From c0f6551cf442e522a6e7f197d2574a3b5b4e8ab2 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 22 Nov 2026 18:24:15 +0100 Subject: [PATCH] test(server): send the API key requests without awaiting in a loop Server lint counted one no-await-in-loop warning over the tests baseline, from the loop in the new API key test. --- server/tests/e2e/sessions.e2e.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/tests/e2e/sessions.e2e.test.ts b/server/tests/e2e/sessions.e2e.test.ts index 842203a88..4f58ff322 100644 --- a/server/tests/e2e/sessions.e2e.test.ts +++ b/server/tests/e2e/sessions.e2e.test.ts @@ -322,11 +322,9 @@ describe('Sessions e2e (sign-in sessions that can be ended)', () => { const forged = `trek_session=${jwt.sign({ id: user.id, pv: 0, iat }, 'not-the-server-secret', { expiresIn: 86400, algorithm: 'HS256' })}`; const genuine = sessionCookie(user.id, 0, { lifetime: 86400, consumed: 60000 }); - for (const cookie of [forged, genuine]) { - const res = await request(server) - .get('/api/v1/trips') - .set('Authorization', `Bearer ${key}`) - .set('Cookie', cookie); + const withKey = (cookie: string) => + request(server).get('/api/v1/trips').set('Authorization', `Bearer ${key}`).set('Cookie', cookie); + for (const res of [await withKey(forged), await withKey(genuine)]) { expect(res.status).toBe(200); const set = (res.headers['set-cookie'] ?? []) as unknown as string[]; expect(set.some((c) => c.startsWith('trek_session='))).toBe(false);