@dossierhq/integration-test
Version:
Integration test to ensure that different Dossier database adapters work as expected.
8 lines (7 loc) • 1.62 kB
TypeScript
import { type ArchiveEntitySyncEvent, type ChangelogEvent, type Connection, type CreateEntitySyncEvent, type CreatePrincipalSyncEvent, type DeleteEntitiesSyncEvent, type Edge, type EntityChangelogEvent, type ErrorType, type OkResult, type PublishEntitiesSyncEvent, type Result, type SchemaChangelogEvent, type SyncEvent, type UnarchiveEntitySyncEvent, type UnpublishEntitiesSyncEvent, type UpdateEntitySyncEvent, type UpdateSchemaSyncEvent } from '@dossierhq/core';
type ChangelogEventWithoutId = Omit<SchemaChangelogEvent, 'id'> | Omit<EntityChangelogEvent, 'id'>;
type WithCreatedAt<T extends SyncEvent> = Omit<T, 'id' | 'createdAt'>;
type SyncEventWithoutIdAndCreatedAt = WithCreatedAt<CreatePrincipalSyncEvent> | WithCreatedAt<DeleteEntitiesSyncEvent> | WithCreatedAt<UpdateSchemaSyncEvent> | WithCreatedAt<CreateEntitySyncEvent> | WithCreatedAt<UpdateEntitySyncEvent> | WithCreatedAt<PublishEntitiesSyncEvent> | WithCreatedAt<UnpublishEntitiesSyncEvent> | WithCreatedAt<ArchiveEntitySyncEvent> | WithCreatedAt<UnarchiveEntitySyncEvent>;
export declare function assertChangelogEventsConnection(actualResult: Result<Connection<Edge<ChangelogEvent, ErrorType>> | null, typeof ErrorType.BadRequest | typeof ErrorType.NotAuthorized | typeof ErrorType.Generic>, expectedNodes: ChangelogEventWithoutId[]): asserts actualResult is OkResult<Connection<Edge<ChangelogEvent, ErrorType>> | null, typeof ErrorType.BadRequest | typeof ErrorType.NotAuthorized | typeof ErrorType.Generic>;
export declare function assertSyncEventsEqual(actualEvents: SyncEvent[], expectedEvents: SyncEventWithoutIdAndCreatedAt[]): void;
export {};