From f1b7ff0f7c2a9f38077a7d86174f0467d8fb7938 Mon Sep 17 00:00:00 2001 From: Mateus Badan de Pieri Date: Wed, 5 Apr 2023 16:30:00 +0100 Subject: [PATCH] fixing expect on throw --- packages/backend-core/src/tenancy/tests/tenancy.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/tenancy/tests/tenancy.spec.ts b/packages/backend-core/src/tenancy/tests/tenancy.spec.ts index 7323934bb3..05dc6e93cb 100644 --- a/packages/backend-core/src/tenancy/tests/tenancy.spec.ts +++ b/packages/backend-core/src/tenancy/tests/tenancy.spec.ts @@ -152,9 +152,9 @@ describe("getTenantIDFromCtx", () => { TenantResolutionStrategy.PATH, ], } - expect(() => getTenantIDFromCtx(ctx, mockOpts)).rejects.toThrowError( - "Tenant id not set" - ) + expect(getTenantIDFromCtx(ctx, mockOpts)).toBeNull() + expect(ctx.throw).toBeCalledTimes(1) + expect(ctx.throw).toBeCalledWith(403, "Tenant id not set") }) it("returns null if allowNoTenant is true", () => {