From 6e9f11f6a7a7c7ec02c47ae210d8f24196f8dd32 Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Tue, 9 Dec 2025 14:52:40 +0100 Subject: [PATCH] test: Correctly mock STRIPE_ENABLED --- .../src/services/__tests__/BillingLimitService.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/api/src/services/__tests__/BillingLimitService.test.ts b/apps/api/src/services/__tests__/BillingLimitService.test.ts index 19adbe8..e4fa25b 100644 --- a/apps/api/src/services/__tests__/BillingLimitService.test.ts +++ b/apps/api/src/services/__tests__/BillingLimitService.test.ts @@ -5,6 +5,15 @@ import {EmailService} from '../EmailService'; import {factories, getPrismaClient} from '../../../../../test/helpers'; import {redis} from '../../database/redis'; +// Mock STRIPE_ENABLED to be true for free tier tests +vi.mock('../../app/constants.js', async () => { + const actual = await vi.importActual('../../app/constants.js'); + return { + ...actual, + STRIPE_ENABLED: true, + }; +}); + describe('BillingLimitService - Critical Enforcement', () => { let projectId: string; let contactId: string;