# TestMongooseContext Class

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

# Overview

class TestMongooseContext extends PlatformTest {
    static getMongo(): MongoMemoryServer;
    static install(options?: any): Promise<{
        url: string;
        connectionOptions: {
            useUnifiedTopology: boolean;
            useNewUrlParser: boolean;
        };
    }>;
    /**
     * Connect to the in-memory database.
     */
    static bootstrap(mod: any, options?: Partial<TsED.Configuration>): () => Promise<void>;
    static create(options?: Partial<TsED.Configuration>): 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 reset(): Promise<void>;
    /**
     *
     */
    static clearDatabase(): Promise<void>;
    static getMongooseOptions(): Promise<{
        url: string;
        connectionOptions: {
            useUnifiedTopology: boolean;
            useNewUrlParser: boolean;
        };
    }>;
}

# Members

static getMongo(): MongoMemoryServer;

static install(options?: any): Promise<{
     url: string;
     connectionOptions: {
         useUnifiedTopology: boolean;
         useNewUrlParser: boolean;
     };
 }>;

static bootstrap(mod: any, options?: Partial<TsED.Configuration>): () => Promise<void>;

Connect to the in-memory database.


static create(options?: Partial<TsED.Configuration>): 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;
     };
 }>;

Other topics