# TestMongooseContext Class

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

# Overview

class TestMongooseContext extends TestContext {
<span class="token keyword">static</span> <span class="token function">install</span><span class="token punctuation">(</span>options?<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>
/**
 * Connect to the in-memory database.
 */
<span class="token keyword">static</span> <span class="token function">bootstrap</span><span class="token punctuation">(</span>mod<span class="token punctuation">:</span> <a href="/api/core/interfaces/Type.html"><span class="token">Type</span></a>&lt;<a href="/api/common/platform-express/components/ServerLoader.html"><span class="token">ServerLoader</span></a>&gt;<span class="token punctuation">,</span> options?<span class="token punctuation">:</span> Partial&lt;TsED.<a href="/api/di/decorators/Configuration.html"><span class="token">Configuration</span></a>&gt;<span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> =&gt; Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>
<span class="token keyword">static</span> <span class="token function">create</span><span class="token punctuation">(</span>options?<span class="token punctuation">:</span> Partial&lt;TsED.<a href="/api/di/decorators/Configuration.html"><span class="token">Configuration</span></a>&gt;<span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>
/**
 * Resets the test injector of the test context<span class="token punctuation">,</span> so it won't pollute your next test. Call this in your `tearDown` logic.
 */
<span class="token keyword">static</span> <span class="token function">reset</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>
/**
 *
 */
<span class="token keyword">static</span> <span class="token function">clearDatabase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>
<span class="token keyword">static</span> <span class="token function">getMongooseOptions</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token punctuation">{</span>
    url<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
    connectionOptions<span class="token punctuation">:</span> <span class="token punctuation">{</span>
        useUnifiedTopology<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
        useNewUrlParser<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
        autoReconnect<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
        reconnectTries<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
        reconnectInterval<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>&gt;<span class="token punctuation">;</span>

}