From 4e1a7d0985c0ffa7ba61cb5721fb7a79f213a6af Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 13 Nov 2024 19:54:44 +0100 Subject: [PATCH] fixup Signed-off-by: Matteo Collina --- test/plugin.v2.test.js | 3 ++- test/plugin.v3.test.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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')