Loading...
Loading...
Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.
npx skill4agent add latitude-dev/latitude-llm testingsrc/index.ts./test/./testing/src/index.ts/testingpackage.jsonexports{
"exports": {
".": "./src/index.ts",
"./testing": "./src/testing/my-test-helpers.ts"
}
}import { Fake } from "@platform/my-package/testing"noRestrictedImportspackages/vitest-config/index.tsvi.mockvi.fnchdb@platform/testkit@electric-sql/pglite@platform/testkit@platform/testkitimport { setupTestPostgres } from "@platform/testkit"
import { beforeAll, describe, it } from "vitest"
const pg = setupTestPostgres()
describe("MyRepository", () => {
it("does something", async () => {
// pg.postgresDb is a real Drizzle instance backed by PGlite in-memory
// pg.db is the lower-level Drizzle/PGlite instance for direct queries
})
})setupTestPostgres()latitude_app@platform/testkitimport { setupTestClickHouse } from "@platform/testkit"
import { beforeAll, describe, it } from "vitest"
const ch = setupTestClickHouse()
describe("MyRepository", () => {
let repo: ReturnType<typeof createMyRepository>
beforeAll(() => {
repo = createMyRepository(ch.client)
})
it("does something", async () => {
// ch.client is a real ClickHouseClient backed by chdb in-memory
})
})setupTestClickHouse()schema.sqlpnpm --filter @platform/db-clickhouse ch:schema:dumpvi.mockvi.fn()argMaxGROUP BY