From 02434350894796b6c781b2f84f141dec5e44dba8 Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Fri, 1 Nov 2024 21:05:11 +0000 Subject: [PATCH] Fix node-test-runner tsx injection on windows --- v-next/hardhat-node-test-runner/src/task-action.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v-next/hardhat-node-test-runner/src/task-action.ts b/v-next/hardhat-node-test-runner/src/task-action.ts index b04abf83cc..b467f258d1 100644 --- a/v-next/hardhat-node-test-runner/src/task-action.ts +++ b/v-next/hardhat-node-test-runner/src/task-action.ts @@ -4,7 +4,7 @@ import type { LastParameter } from "@ignored/hardhat-vnext/types/utils"; import { pipeline } from "node:stream/promises"; import { run } from "node:test"; -import { fileURLToPath } from "node:url"; +import { URL } from "node:url"; import { hardhatTestReporter } from "@ignored/hardhat-vnext-node-test-reporter"; import { getAllFilesMatching } from "@ignored/hardhat-vnext-utils/fs"; @@ -66,8 +66,8 @@ const testWithHardhat: NewTaskActionFunction = async ( return 0; } - const tsx = fileURLToPath(import.meta.resolve("tsx/esm")); - process.env.NODE_OPTIONS = `--import ${tsx}`; + const tsx = new URL(import.meta.resolve("tsx/esm")); + process.env.NODE_OPTIONS = `--import "${tsx.href}"`; async function runTests(): Promise { let failures = 0;