diff --git a/test/test-cookie-param.v3.js b/test/test-cookie-param.v3.js index c8e03ca..44b1f24 100644 --- a/test/test-cookie-param.v3.js +++ b/test/test-cookie-param.v3.js @@ -24,7 +24,7 @@ test("route registration succeeds with cookie param", (t, done) => { serviceHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts); fastify.ready((err) => { if (err) { @@ -43,7 +43,7 @@ test("route registration inserts cookie schema", (t, done) => { addCookieSchema: true, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); // Register onRoute handler which will be called when the plugin registers routes in the specification. let hadCookieSchema = false; fastify.addHook("onRoute", (routeOptions) => { diff --git a/test/test-petstore-example.js b/test/test-petstore-example.js index e84401a..5817cba 100644 --- a/test/test-petstore-example.js +++ b/test/test-petstore-example.js @@ -5,7 +5,7 @@ import Fastify from "fastify"; import petstoreExample, { options } from "../examples/petstore/index.js"; test("/v2/pet/24 works", async (t) => { - const fastify = Fastify(structuredClone(options)); + const fastify = Fastify(options); fastify.register(petstoreExample, {}); const res = await fastify.inject({ method: "GET", @@ -23,7 +23,7 @@ test("/v2/pet/24 works", async (t) => { }); test("/v2/pet/myPet returns Fastify validation error", async (t) => { - const fastify = Fastify(structuredClone(options)); + const fastify = Fastify(options); fastify.register(petstoreExample, {}); const res = await fastify.inject({ method: "GET", @@ -37,7 +37,7 @@ test("/v2/pet/myPet returns Fastify validation error", async (t) => { }); test("v2/pet/findByStatus?status=available&status=pending returns 'not implemented'", async (t) => { - const fastify = Fastify(structuredClone(options)); + const fastify = Fastify(options); fastify.register(petstoreExample, {}); const res = await fastify.inject({ method: "GET", @@ -54,7 +54,7 @@ test("v2/pet/findByStatus?status=available&status=pending returns 'not implement }); test("v2/pet/0 returns serialization error", async (t) => { - const fastify = Fastify(structuredClone(options)); + const fastify = Fastify(options); fastify.register(petstoreExample, {}); const res = await fastify.inject({ method: "GET", diff --git a/test/test-plugin.v2.js b/test/test-plugin.v2.js index 884584e..e768039 100644 --- a/test/test-plugin.v2.js +++ b/test/test-plugin.v2.js @@ -214,7 +214,7 @@ test("invalid service definition throws error ", (t, done) => { }); test("full pet store V2 definition does not throw error ", (t, done) => { - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, { specification: structuredClone(petStoreSpec), serviceHandlers, @@ -292,7 +292,7 @@ test("generic path parameters override works", async (t) => { }); test("schema attributes for non-body parameters work", async (t) => { - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, { specification: structuredClone(petStoreSpec), serviceHandlers, diff --git a/test/test-plugin.v3.js b/test/test-plugin.v3.js index dce6282..c8ac682 100644 --- a/test/test-plugin.v3.js +++ b/test/test-plugin.v3.js @@ -248,7 +248,7 @@ test("response schema works with invalid response", async (t) => { }); test("yaml spec works", async (t) => { - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, yamlOpts); const res = await fastify.inject({ @@ -315,7 +315,7 @@ test("missing service definition throws error ", (t, done) => { }); test("full pet store V3 definition does not throw error ", (t, done) => { - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); // dummy parser to fix coverage testing fastify.addContentTypeParser( "application/xml", @@ -341,7 +341,7 @@ test("V3.0.1 definition does not throw error", (t, done) => { serviceHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts301); fastify.ready((err) => { if (err) { @@ -361,7 +361,7 @@ test("V3.0.2 definition does not throw error", (t, done) => { serviceHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts302); fastify.ready((err) => { if (err) { @@ -381,7 +381,7 @@ test("V3.0.3 definition does not throw error", (t, done) => { serviceHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts303); fastify.ready((err) => { if (err) { diff --git a/test/test-recursive.v3.js b/test/test-recursive.v3.js index 1eb3975..60cea40 100644 --- a/test/test-recursive.v3.js +++ b/test/test-recursive.v3.js @@ -24,7 +24,7 @@ test("route registration succeeds with recursion", (t, done) => { serviceHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts); fastify.ready((err) => { if (err) { diff --git a/test/test-securityHandlers.js b/test/test-securityHandlers.js index e0053a1..73dbe1d 100644 --- a/test/test-securityHandlers.js +++ b/test/test-securityHandlers.js @@ -42,7 +42,7 @@ async function doTest(version, testSpecName, petStoreSpecName, prefix) { securityHandlers, }; - const fastify = Fastify(structuredClone(noStrict)); + const fastify = Fastify(noStrict); fastify.register(fastifyOpenapiGlue, opts); fastify.ready((err) => { if (err) {