3.2.6 • Published 6 months ago
@types/node-mongodb-fixtures v3.2.6
Installation
npm install --save @types/node-mongodb-fixtures
Summary
This package contains type definitions for node-mongodb-fixtures (https://github.com/cdimascio/node-mongodb-fixtures#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-mongodb-fixtures.
index.d.ts
// Type definitions for node-mongodb-fixtures 3.2
// Project: https://github.com/cdimascio/node-mongodb-fixtures#readme
// Definitions by: Chuah Chee Shian (shian15810) <https://github.com/shian15810>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 4.1
import { MongoClientOptions } from 'mongodb';
/**
* Setup and tear down test fixtures with MongoDB.
*
* Use custom scripts to create indexes and more!
*
* @see https://www.npmjs.com/package/node-mongodb-fixtures
*/
declare class Fixtures {
constructor(options?: Fixtures.Options);
/**
* @param uri MongoDB connection string.
*
* @param options MongoDB connection options.
*
* @param dbName Identifies a database to switch to. Useful when the db in the connection string differs from the db you want to connect to.
*/
connect(uri: string, options?: MongoClientOptions, dbName?: string): Promise<this>;
load(): Promise<this>;
unload(): Promise<this>;
disconnect(): Promise<void>;
}
declare namespace Fixtures {
interface Options {
/**
* Specifiy the fixtures directory or default to `./fixtures`.
*/
dir?: string | undefined;
/**
* Filter the fixtures present in the directory with a regex pattern.
*/
filter?: string | undefined;
/**
* Specify `true` to mute the log output or default to `false`.
*/
mute?: boolean | undefined;
}
}
export = Fixtures;
Additional Details
- Last updated: Sun, 24 Apr 2022 14:31:48 GMT
- Dependencies: @types/mongodb
- Global values: none
Credits
These definitions were written by Chuah Chee Shian (shian15810).