From 015fe08aa45fdfd014583bb2576ef71fd98b1f39 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Fri, 17 May 2024 21:09:28 +0200 Subject: [PATCH] import `fs` statically --- tests/utils/npm-utils.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/npm-utils.spec.js b/tests/utils/npm-utils.spec.js index 29f86478..80daf728 100644 --- a/tests/utils/npm-utils.spec.js +++ b/tests/utils/npm-utils.spec.js @@ -18,6 +18,7 @@ import { } from "../../lib/utils/npm-utils.js"; import { defineInMemoryFs } from "../_utils/in-memory-fs.js"; import { assert, describe, afterEach, it } from "vitest"; +import fs from "fs"; //------------------------------------------------------------------------------ // Helpers @@ -30,7 +31,6 @@ import { assert, describe, afterEach, it } from "vitest"; */ async function useInMemoryFileSystem(files) { const inMemoryFs = defineInMemoryFs({ files }); - const { default: fs } = await import("fs"); sinon.replace(fs, "readFileSync", inMemoryFs.readFileSync); sinon.replace(fs, "existsSync", inMemoryFs.existsSync);