@emigrate/cli
Version:
Emigrate is a tool for managing database migrations. It is designed to be simple yet support advanced setups, modular and extensible.
16 lines • 1.45 kB
TypeScript
import { type Mock } from 'node:test';
import { type SerializedError, type EmigrateReporter, type FailedMigrationHistoryEntry, type MigrationHistoryEntry, type MigrationMetadata, type NonFailedMigrationHistoryEntry, type Storage } from '@emigrate/types';
export type Mocked<T> = {
[K in keyof T]: Mock<T[K]>;
};
export declare function noop(): Promise<void>;
export declare function getErrorCause(error: Error | undefined): Error | SerializedError | undefined;
export declare function getMockedStorage(historyEntries: Array<string | MigrationHistoryEntry>): Mocked<Storage>;
export declare function getMockedReporter(): Mocked<Required<EmigrateReporter>>;
export declare function toMigration(cwd: string, directory: string, name: string): MigrationMetadata;
export declare function toMigrations(cwd: string, directory: string, names: string[]): MigrationMetadata[];
export declare function toEntry(name: MigrationHistoryEntry): MigrationHistoryEntry;
export declare function toEntry<S extends MigrationHistoryEntry['status']>(name: string, status?: S): S extends 'failed' ? FailedMigrationHistoryEntry : NonFailedMigrationHistoryEntry;
export declare function toEntries(names: Array<string | MigrationHistoryEntry>, status?: MigrationHistoryEntry['status']): MigrationHistoryEntry[];
export declare function assertErrorEqualEnough(actual?: Error | SerializedError, expected?: Error, message?: string): void;
//# sourceMappingURL=test-utils.d.ts.map