MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / setupPostgresFixtures

Function setupPostgresFixtures

test/fixtures.ts:397–416  ·  view source on GitHub ↗
(
  projectId: string,
  orgId: string
)

Source from the content-addressed store, hash-verified

395// ---------------------------------------------------------------------------
396
397export async function setupPostgresFixtures(
398 projectId: string,
399 orgId: string
400): Promise<void> {
401 const db = getDb();
402 try {
403 await db.organization.upsert({
404 where: { id: orgId },
405 create: { id: orgId, name: 'Test Org', timezone: 'UTC' },
406 update: { timezone: 'UTC' },
407 });
408 await db.project.upsert({
409 where: { id: projectId },
410 create: { id: projectId, name: 'Test Project', organizationId: orgId },
411 update: {},
412 });
413 } finally {
414 await db.$disconnect();
415 }
416}
417
418export async function teardownPostgresFixtures(
419 projectId: string,

Callers 1

setupFunction · 0.90

Calls 1

getDbFunction · 0.85

Tested by

no test coverage detected