fixing expect on throw

This commit is contained in:
Mateus Badan de Pieri 2023-04-05 16:30:00 +01:00
parent b0df710a2a
commit f1b7ff0f7c
1 changed files with 3 additions and 3 deletions

View File

@ -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", () => {