vitest-mms
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -0,3 +1,5 @@ | ||
import { GlobalSetupContext } from 'vitest/node'; | ||
export { ResolvedConfig } from 'vitest/node'; | ||
import { MongoMemoryServer } from 'mongodb-memory-server'; | ||
export { ProvidedContext } from 'vitest'; | ||
import { GlobalSetupContext } from 'vitest/node'; | ||
@@ -9,4 +11,12 @@ declare module "vitest" { | ||
} | ||
declare function setup({ provide }: GlobalSetupContext): Promise<() => Promise<void>>; | ||
type MongoMemoryServerOpts = Parameters<typeof MongoMemoryServer.create>[0]; | ||
declare module "vitest/node" { | ||
interface ResolvedConfig { | ||
vitestMms?: { | ||
mongodbMemoryServerOptions: MongoMemoryServerOpts; | ||
}; | ||
} | ||
} | ||
declare function setup({ provide, config }: GlobalSetupContext): Promise<() => Promise<void>>; | ||
export { setup as default }; |
@@ -6,2 +6,3 @@ import * as vitest from 'vitest'; | ||
import 'vitest/node'; | ||
import 'mongodb-memory-server'; | ||
@@ -8,0 +9,0 @@ declare const mmsTest: vitest.TestAPI<{ |
@@ -5,2 +5,3 @@ import { MongoClient, Db } from 'mongodb'; | ||
import 'vitest/node'; | ||
import 'mongodb-memory-server'; | ||
@@ -7,0 +8,0 @@ declare module "vitest" { |
@@ -6,2 +6,3 @@ import * as vitest from 'vitest'; | ||
import 'vitest/node'; | ||
import 'mongodb-memory-server'; | ||
@@ -8,0 +9,0 @@ declare const mmsTest: vitest.TestAPI<{ |
@@ -5,2 +5,3 @@ import { Connection } from 'mongoose'; | ||
import 'vitest/node'; | ||
import 'mongodb-memory-server'; | ||
@@ -7,0 +8,0 @@ declare module "vitest" { |
{ | ||
"name": "vitest-mms", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "mongodb-memory-server integration for vitest", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -39,2 +39,9 @@ # vitest-mms [![NPM Version](https://img.shields.io/npm/v/vitest-mms)](https://www.npmjs.com/package/vitest-mms) | ||
setupFiles: ["vitest-mms/mongodb/setupFile"], | ||
vitestMms: { | ||
// optional configuration | ||
mongodbMemoryServer: { | ||
// these options are passed to MongoMemoryServer.create(), see https://typegoose.github.io/mongodb-memory-server/docs/guides/quick-start-guide#normal-server | ||
// replSet: { count: 4 } | ||
}, | ||
}, | ||
}, | ||
@@ -83,2 +90,9 @@ }); | ||
setupFile: ["vitest-mms/mongoose/setupFile"], | ||
vitestMms: { | ||
// optional configuration | ||
mongodbMemoryServer: { | ||
// these options are passed to MongoMemoryServer.create(), see https://typegoose.github.io/mongodb-memory-server/docs/guides/quick-start-guide#normal-server | ||
// replSet: { count: 4 } | ||
}, | ||
}, | ||
}, | ||
@@ -85,0 +99,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14272
252
153