From cee5702a0e0a2ba97fd280f9a82c3db9b6a40260 Mon Sep 17 00:00:00 2001 From: Alessio Gravili Date: Mon, 3 Jun 2024 15:37:43 -0400 Subject: [PATCH] fix incorrect __dirname usage --- test/collections-graphql/int.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/collections-graphql/int.spec.ts b/test/collections-graphql/int.spec.ts index b9d395716ac..cbba179d906 100644 --- a/test/collections-graphql/int.spec.ts +++ b/test/collections-graphql/int.spec.ts @@ -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',