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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user