From da8b89f3a2457feb58c9f6fae2a081a89c1b0d6f Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Wed, 25 Dec 2024 16:31:28 +0530 Subject: [PATCH] Fix unit tests --- packages/trpc/tests/routers/extension.spec.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/trpc/tests/routers/extension.spec.ts b/packages/trpc/tests/routers/extension.spec.ts index e928b5bb4..e03a5ab94 100644 --- a/packages/trpc/tests/routers/extension.spec.ts +++ b/packages/trpc/tests/routers/extension.spec.ts @@ -1,10 +1,21 @@ -import { describe, expect, it } from 'vitest'; +import { afterAll, beforeAll, describe, expect, it } from 'vitest'; import { getTrpcCaller } from '../test-helpers'; +import { anonymousSignIn, deleteFirebaseUser, FirebaseUser } from '../firebase'; describe('extension router test', () => { - const caller = getTrpcCaller(); + let user: FirebaseUser; + + beforeAll(async () => { + const userCredential = await anonymousSignIn(); + user = userCredential.user; + }); + + afterAll(async () => { + await deleteFirebaseUser(user); + }); it('should have expected response', async () => { + const caller = getTrpcCaller(); const output = await caller.extension.latest(); expect(output).toEqual( expect.objectContaining({