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,5 @@
|
||||
import type { BlockField } from '../../packages/payload/src/fields/config/types.js'
|
||||
import type { Payload } from '../../packages/payload/src/index.js'
|
||||
|
||||
import { getPayload } from '../../packages/payload/src/index.js'
|
||||
import { startMemoryDB } from '../startMemoryDB.js'
|
||||
import configPromise from './config.js'
|
||||
@@ -13,6 +12,12 @@ describe('Config', () => {
|
||||
payload = await getPayload({ config })
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
if (typeof payload.db.destroy === 'function') {
|
||||
await payload.db.destroy()
|
||||
}
|
||||
})
|
||||
|
||||
describe('payload config', () => {
|
||||
it('allows a custom field at the config root', () => {
|
||||
const { config } = payload
|
||||
|
||||
Reference in New Issue
Block a user