MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createTestOrg

Function createTestOrg

apps/web/src/lib/creditExpirationOrg.test.ts:13–22  ·  view source on GitHub ↗
(
  ownerId: string,
  overrides: Partial<typeof organizations.$inferInsert> = {}
)

Source from the content-addressed store, hash-verified

11import { eq, inArray } from 'drizzle-orm';
12import { randomUUID } from 'node:crypto';
13
14async 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
25describe('fetchExpiringTransactionsForOrganization', () => {

Callers 1

Calls 3

createOrganizationFunction · 0.90
setMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected