Skip to content

Commit

Permalink
fix incorrect __dirname usage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed Jun 3, 2024
1 parent db9f0ec commit cee5702
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/collections-graphql/int.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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))
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit cee5702

Please sign in to comment.