chore: attach mongoMemoryServer to db and destroy in tests (#5326)
* chore: attach mongoMemoryServer to db and destroy in tests * bump mongodb-memory-server to 9.x --------- Co-authored-by: Paul Popus <paul@nouance.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { randomBytes } from 'crypto'
|
||||
|
||||
import type { Payload } from '../../packages/payload/src/index.js'
|
||||
import { getPayload } from '../../packages/payload/src/index.js'
|
||||
import type {
|
||||
ChainedRelation,
|
||||
CustomIdNumberRelation,
|
||||
@@ -9,8 +10,6 @@ import type {
|
||||
Post,
|
||||
Relation,
|
||||
} from './payload-types.js'
|
||||
|
||||
import { getPayload } from '../../packages/payload/src/index.js'
|
||||
import { NextRESTClient } from '../helpers/NextRESTClient.js'
|
||||
import { startMemoryDB } from '../startMemoryDB.js'
|
||||
import configPromise from './config.js'
|
||||
@@ -41,7 +40,7 @@ describe('Relationships', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
if (typeof payload.db.destroy === 'function') {
|
||||
await payload.db.destroy(payload)
|
||||
await payload.db.destroy()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user