ConusAI vendor v0.1.0-beta.114
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-beta.114
2026-11-14 09:56:45 +00:00
commit 1ce8d23c35
867 changed files with 122104 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// `/api/ready` (spec §13): the migration level it compares against, read from this repository's
// folders. The verdict is `@conusai-kit/host/http`'s `checkReadiness` and its tests.
import { readdirSync } from "node:fs"
import { appRoot, expectedMigrations, GRANT_MIGRATIONS, missingMigrations } from "@app/config"
import { appModules } from "@app/modules"
import { buildRegistry } from "@conusai-kit/core"
import { describe, expect, it } from "vitest"
describe("the migration level", () => {
it("lists the app's files, then each module's, then the grants the migrate job adds", async () => {
const expected = await expectedMigrations(buildRegistry([...appModules]))
const files = readdirSync(`${appRoot()}/migrations/postgres`)
.filter((name) => name.endsWith(".sql"))
.map((name) => name.replace(/\.sql$/, ""))
.sort()
expect(expected.slice(0, files.length)).toEqual(files)
expect(expected).toContain("notes/0001_notes") // kit:notes
expect(expected.slice(-GRANT_MIGRATIONS.length)).toEqual([...GRANT_MIGRATIONS])
})
it("names what a database lacks", () => {
expect(missingMigrations(["a", "b", "c"], new Set(["a", "c", "z"]))).toEqual(["b"])
})
})