mysqlMigratorConformanceCases

VariableExperimental

Signature

const mysqlMigratorConformanceCases: ConformanceTestCase<MysqlMigratorConformanceContext>[];

mysql/src/conformance/migrator-conformance.ts:87

Cases that check createMysqlMigrator 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 createMysqlMigratorConformanceContext. Works with any test runner.

Example

TypeScript

import { afterAll, test } from "vitest";

const pool = createPool({ ...connectionOptions, database: "app" });
const context = createMysqlMigratorConformanceContext({
  stateProvider: createMysql2PoolStateProvider({ pool }),
});
afterAll(async () => pool.end());

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

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open