# TestMongooseContext Class

Module
import { TestMongooseContext } from "@tsed/testing-mongoose"
Source/packages/testing-mongoose/src/TestMongooseContext.ts

# Overview

class TestMongooseContext extends TestContext {
    static install(options?: any): Promise<void>;
    static bootstrap(mod: Type<ServerLoader>, options?: Partial<IDIConfigurationOptions>): () => Promise<void>;
    static create(options?: Partial<IDIConfigurationOptions>): Promise<void>;
    static reset(): Promise<void>;
    static clearDatabase(): Promise<void>;
    static getMongooseOptions(): Promise<{
        url: string;
        connectionOptions: {
            useUnifiedTopology: boolean;
            useNewUrlParser: boolean;
            autoReconnect: boolean;
            reconnectTries: number;
            reconnectInterval: number;
        };
    }>;
}

# Members

static install(options?: any): Promise<void>

static bootstrap(mod: Type<ServerLoader>, options?: Partial<IDIConfigurationOptions>): () => Promise<void>

Connect to the in-memory database.


static create(options?: Partial<IDIConfigurationOptions>): Promise<void>

static reset(): Promise<void>

Resets the test injector of the test context, so it won't pollute your next test. Call this in your tearDown logic.


static clearDatabase(): Promise<void>

static getMongooseOptions(): Promise<{
     url: string;
     connectionOptions: {
         useUnifiedTopology: boolean;
         useNewUrlParser: boolean;
         autoReconnect: boolean;
         reconnectTries: number;
         reconnectInterval: number;
     };
 }>;