Skip to content

Commit

Permalink
Merge pull request #5926 from NomicFoundation/fix-node-test-runner-ts…
Browse files Browse the repository at this point in the history
…x-injection-on-windows

Fix node-test-runner tsx injection on windows
  • Loading branch information
alcuadrado authored Nov 1, 2024
2 parents f4552e9 + 0243435 commit bc0ecc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v-next/hardhat-node-test-runner/src/task-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -66,8 +66,8 @@ const testWithHardhat: NewTaskActionFunction<TestActionArguments> = 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<number> {
let failures = 0;
Expand Down

0 comments on commit bc0ecc6

Please sign in to comment.