chore: mongodb destroy connections outside of tests
This commit is contained in:
@@ -4,10 +4,12 @@ import mongoose from 'mongoose'
|
||||
|
||||
import type { MongooseAdapter } from './index'
|
||||
|
||||
export const destroy: Destroy = async function destroy(this: MongooseAdapter) {
|
||||
export const destroy: Destroy = async function destroy (this: MongooseAdapter) {
|
||||
if (this.mongoMemoryServer) {
|
||||
await mongoose.connection.dropDatabase()
|
||||
await mongoose.connection.close()
|
||||
await this.mongoMemoryServer.stop()
|
||||
} else {
|
||||
await mongoose.connection.close()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user