Skip to content

Commit

Permalink
refactor: move nodeVersion util to top
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 19, 2023
1 parent 7efe1f1 commit f1ffb74
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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=/"
Expand Down

0 comments on commit f1ffb74

Please sign in to comment.