(overrides: Array<{
credits_per_block: number
block_duration_hours: number
weekly_credit_limit: number
}>)
| 229 | |
| 230 | describe('getSubscriptionLimits', () => { |
| 231 | function createConnMock(overrides: Array<{ |
| 232 | credits_per_block: number |
| 233 | block_duration_hours: number |
| 234 | weekly_credit_limit: number |
| 235 | }>) { |
| 236 | return { |
| 237 | select: () => ({ |
| 238 | from: () => ({ |
| 239 | where: () => ({ |
| 240 | limit: () => overrides, |
| 241 | }), |
| 242 | }), |
| 243 | }), |
| 244 | update: () => ({}), |
| 245 | insert: () => ({}), |
| 246 | } as any |
| 247 | } |
| 248 | |
| 249 | it('should use limit override when one exists', async () => { |
| 250 | const conn = createConnMock([{ |