UNPKG

mongodoki

Version:

A tool to on-the-fly run MongoDB as a Docker Container, data restoring included

46 lines (45 loc) 1.18 kB
import { Logger } from 'debuggo'; import Docker from 'dockerode'; export interface Volume { hostDir: string; containerDir: string; } export interface TestDokiOptions { image?: string; tag?: string; containerName?: string; hostPort?: number; ports?: { host: number; container?: number; }[]; reuse?: boolean; volume?: Volume; } export declare class TestDoki { protected opts: TestDokiOptions; protected logger: Logger; static DEFAULT_TAG: string; static DEFAULT_CONTAINER: string; constructor(opts?: TestDokiOptions, logger?: Logger); protected getContainer(): Promise<{ container?: Docker.Container; info?: Docker.ContainerInspectInfo; }>; /** * Stop the container */ stop(): Promise<this>; /** * Remove the container and prune all the unused Docker Volumes * on host machine. */ remove(): Promise<this>; /** * Stop and remove the container, see stop() and remove() */ stopAndRemove(): Promise<this>; start(): Promise<this>; protected createAndStart(): Promise<this>; protected pullImage(): Promise<unknown>; }