MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / requireDb

Function requireDb

apps/api/tests/helpers/db.ts:75–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73let warnedAboutSkip = false;
74
75export const requireDb = async (): Promise<boolean> => {
76 if (await isDbAvailable()) {
77 return true;
78 }
79
80 if (process.env.REQUIRE_INTEGRATION_DB === "true") {
81 throw new Error("Integration database is required but unreachable");
82 }
83
84 if (!warnedAboutSkip) {
85 console.log(
86 "(integration tests skipped — DATABASE_URL not set or DB unreachable)"
87 );
88 warnedAboutSkip = true;
89 }
90
91 return false;
92};
93
94/**
95 * Tables to clear between tests, in child-first dependency order.

Calls 1

isDbAvailableFunction · 0.85

Tested by

no test coverage detected