Skip to content

Commit 38d192d

Browse files
committed
test(billing): stabilize member ledger timeout checks
1 parent b653f5e commit 38d192d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/sim/lib/billing/organizations/member-limits.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
queueTableRows,
77
resetDbChainMock,
88
} from '@sim/testing/mocks/database.mock'
9-
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'
9+
import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1010
import { USAGE_LEDGER_STATEMENT_TIMEOUT_MS } from '@/lib/billing/constants'
1111

1212
vi.mock('@/lib/billing/core/billing', () => billingCoreMock)
@@ -21,9 +21,14 @@ const mockGetOrganizationSubscription = billingCoreMockFns.mockGetOrganizationSu
2121
const { eq: mockEq, gte: mockGte, isNull: mockIsNull, lt: mockLt, or: mockOr } = drizzleOrmMock
2222

2323
beforeEach(() => {
24+
vi.useFakeTimers({ toFake: ['Date'] })
2425
resetDbChainMock()
2526
})
2627

28+
afterEach(() => {
29+
vi.useRealTimers()
30+
})
31+
2732
afterAll(() => {
2833
resetDbChainMock()
2934
})

0 commit comments

Comments
 (0)