diff --git a/test/plugin.v2.test.js b/test/plugin.v2.test.js index 3eb31b2..2c23fd7 100644 --- a/test/plugin.v2.test.js +++ b/test/plugin.v2.test.js @@ -1,10 +1,11 @@ import { strict as assert } from 'node:assert/strict' import { createRequire } from 'node:module' import { test } from 'node:test' +import { fileURLToPath } from 'node:url' import Fastify from 'fastify' import fastifyOpenapiGlue from '../index.js' const importJSON = createRequire(import.meta.url) -const localFile = (fileName) => new URL(fileName, import.meta.url).pathname +const localFile = (fileName) => fileURLToPath(new URL(fileName, import.meta.url)) const testSpec = await importJSON('./test-swagger.v2.json') const petStoreSpec = await importJSON('./petstore-swagger.v2.json') diff --git a/test/plugin.v3.test.js b/test/plugin.v3.test.js index 16f914c..80df91f 100644 --- a/test/plugin.v3.test.js +++ b/test/plugin.v3.test.js @@ -1,11 +1,12 @@ import { strict as assert } from 'node:assert/strict' import { createRequire } from 'node:module' import { test } from 'node:test' +import { fileURLToPath } from 'node:url' import Fastify from 'fastify' import fastifyOpenapiGlue from '../index.js' const importJSON = createRequire(import.meta.url) -const localFile = (fileName) => new URL(fileName, import.meta.url).pathname +const localFile = (fileName) => fileURLToPath(new URL(fileName, import.meta.url)) const testSpec = await importJSON('./test-openapi.v3.json') const petStoreSpec = await importJSON('./petstore-openapi.v3.json')