import { Db, Collection } from "mongodb"; import MongoEntity from "./mongo_entity"; export interface ITestingOptions { mongoHost?: string; mongoPort?: string; mongoDisposeTimeout?: number; initContext?: (conn: any) => any; testServer?: ITestServer; verbose?: boolean; testDbName?: () => string; } export declare function config({ mongoHost, testDbName, mongoPort, verbose, initContext: ic, testServer: ts, }: ITestingOptions): void; export declare function getDb(): Promise; export interface TestOption { data?: T[]; name?: string; type?: any; entity?: MongoEntity; } export interface TestOptions { entities?: TestOption[]; } export declare function withEntity(test: (...entity: any[]) => any, options?: TestOptions): Promise; export declare function itWithEntity(name: string, func: (...entity: any[]) => any, options?: TestOptions): void; export declare function withContext(test: (context: any) => any, initContextFn?: (conn: any) => any, disconnected?: boolean): Promise; export declare function itWithContext(name: string, func: (context: any) => void, initContextFn?: (conn: any) => any, disconnected?: boolean): void; export interface ITestServer { started: boolean; context: any; startTest(): any; stopTest(): any; } export declare function withServer(test: (server: ITestServer) => any, server?: ITestServer): Promise; export declare function itWithServer(name: string, func: (context: any) => void, server?: ITestServer): void; export declare function getConnector(): Promise<{ collection(name: string): Collection; }>; export declare function stopDatabase(): Promise; export declare function stopServer(): void;