(
ownerId: string,
overrides: Partial<typeof organizations.$inferInsert> = {}
)
| 12 | import { randomUUID } from 'node:crypto'; |
| 13 | |
| 14 | async function createTestOrg( |
| 15 | ownerId: string, |
| 16 | overrides: Partial<typeof organizations.$inferInsert> = {} |
| 17 | ) { |
| 18 | const org = await createOrganization(`test-org-${randomUUID().slice(0, 8)}`, ownerId); |
| 19 | if (Object.keys(overrides).length > 0) { |
| 20 | await db.update(organizations).set(overrides).where(eq(organizations.id, org.id)); |
| 21 | } |
| 22 | return (await db.query.organizations.findFirst({ where: eq(organizations.id, org.id) }))!; |
| 23 | } |
| 24 | |
| 25 | describe('recomputeOrganizationBalances', () => { |
| 26 | let ownerId: string; |
no test coverage detected