From f1ffb7412860e34755ee4551b6195051a41e88a1 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 19 Jul 2023 13:14:22 +0200 Subject: [PATCH] refactor: move nodeVersion util to top --- test/tests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/tests.ts b/test/tests.ts index 5f95fa44a8..76b5b9a331 100644 --- a/test/tests.ts +++ b/test/tests.ts @@ -8,6 +8,9 @@ import { joinURL } from "ufo"; import * as _nitro from "../src"; import type { Nitro } from "../src"; +// Refactor: https://github.com/unjs/std-env/issues/60 +const nodeVersion = Number.parseInt(process.versions.node.match(/^v?(\d+)/)[0]); + const { createNitro, build, prepare, copyPublicAssets, prerender } = (_nitro as any as { default: typeof _nitro }).default || _nitro; @@ -452,10 +455,6 @@ export function testNitro( // (vercel and deno-server uses node only for tests only) const notSplitingPresets = ["node", "nitro-dev", "vercel", "deno-server"]; if (notSplitingPresets.includes(ctx.preset)) { - // Refactor: https://github.com/unjs/std-env/issues/60 - const nodeVersion = Number.parseInt( - process.versions.node.match(/^v?(\d+)/)[0] - ); expectedCookies = nodeVersion < 18 ? "foo=bar, bar=baz, test=value; Path=/, test2=value; Path=/"