test: refactor int tests to use initPayloadInt which reduces boilerplate
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import type { Payload } from '../../packages/payload/src/index.js'
|
||||
import type { NextRESTClient } from '../helpers/NextRESTClient.js'
|
||||
|
||||
import { getPayload } from '../../packages/payload/src/index.js'
|
||||
import { NextRESTClient } from '../helpers/NextRESTClient.js'
|
||||
import { startMemoryDB } from '../startMemoryDB.js'
|
||||
import { initPayloadInt } from '../helpers/initPayloadInt.js'
|
||||
import configPromise from './config.js'
|
||||
|
||||
let restClient: NextRESTClient
|
||||
@@ -10,9 +9,7 @@ let payload: Payload
|
||||
|
||||
describe('Custom GraphQL', () => {
|
||||
beforeAll(async () => {
|
||||
const config = await startMemoryDB(configPromise)
|
||||
payload = await getPayload({ config })
|
||||
restClient = new NextRESTClient(payload.config)
|
||||
;({ payload, restClient } = await initPayloadInt(configPromise))
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -53,7 +53,3 @@ export interface PayloadMigration {
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
declare module 'payload' {
|
||||
export interface GeneratedTypes extends Config {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user