pgMigratorConformanceCases

VariableExperimental

Signature

const pgMigratorConformanceCases: ConformanceTestCase<PgMigratorConformanceContext>[];

postgres/src/conformance/migrator-conformance.ts:90

Cases that check createPgMigrator over a provider: its history, transactional and non-transactional migrations, reverts and lease. Run them one per test in your own test file against a context from createPgMigratorConformanceContext. Works with any test runner.

Example

TypeScript

import { afterAll, test } from "vitest";

const pool = new Pool({ connectionString });
const context = createPgMigratorConformanceContext({
  stateProvider: createPgPoolStateProvider({ pool }),
});
afterAll(async () => pool.end());

for (const conformanceCase of pgMigratorConformanceCases) {
  test(conformanceCase.title, async () => {
    await conformanceCase.run(context);
  });
}

Used in guides

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open