Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

test(integration): refuse non-test databases

Tin0a5a02a7875f
diff --git a/tests/api-integration/helpers/database.ts b/tests/api-integration/helpers/database.ts
index 87075911d..d2bcb3703 100644
--- a/tests/api-integration/helpers/database.ts
+++ b/tests/api-integration/helpers/database.ts
@@ -32,6 +32,13 @@ async function ensureTestDatabaseExists() {
}
const databaseName = getDatabaseName(connectionString);
+
+ if (!databaseName.endsWith("_test")) {
+ throw new Error(
+ `Refusing to manage non-test database "${databaseName}". DATABASE_URL must point to a test database.`,
+ );
+ }
+
const adminClient = new Client({
connectionString: getAdminDatabaseUrl(connectionString),
});