Files
dbx/packages/mcp-server/tests/driver-manifest.test.ts
T
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00

23 lines
795 B
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { test } from "vitest";
import { DBX_CONNECTION_TYPE_DESCRIPTION } from "../src/index.js";
interface DriverManifest {
drivers: Array<{ dbType: string }>;
}
function loadManifest(): DriverManifest {
const path = fileURLToPath(new URL("../../../crates/dbx-core/assets/database-drivers.manifest.json", import.meta.url));
return JSON.parse(readFileSync(path, "utf8")) as DriverManifest;
}
test("add connection database type description includes every manifest database type", () => {
const manifest = loadManifest();
for (const driver of manifest.drivers) {
assert.match(DBX_CONNECTION_TYPE_DESCRIPTION, new RegExp(`\\b${driver.dbType}\\b`));
}
});