feat: match next.js env file loading behavior in bin scripts & importConfig, clean up installed packages & mismatching package versions (#6601)

This commit is contained in:
Alessio Gravili
2024-06-03 17:23:05 -04:00
committed by GitHub
parent 1aece399f7
commit 59cde0dbb3
33 changed files with 503 additions and 939 deletions

View File

@@ -1,5 +1,6 @@
import type { Payload } from 'payload'
import { fileURLToPath } from 'node:url'
import path from 'path'
import { getFileByPath } from 'payload/uploads'
import { mapAsync } from 'payload/utilities'
@@ -16,6 +17,9 @@ const title = 'title'
let restClient: NextRESTClient
let payload: Payload
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
describe('collections-graphql', () => {
beforeAll(async () => {
;({ payload, restClient } = await initPayloadInt(config))
@@ -1077,7 +1081,7 @@ describe('collections-graphql', () => {
})
it('should query upload enabled docs', async () => {
const file = await getFileByPath(path.resolve(__dirname, '../uploads/test-image.jpg'))
const file = await getFileByPath(path.resolve(dirname, '../uploads/test-image.jpg'))
const mediaDoc = await payload.create({
collection: 'media',