fix: restore existsSync in node:fs test mock
This commit is contained in:
1 parent
fea8023ac6
commit
75dc84d9f1
1 file changed
+7
-1
@@ -2,7 +2,13 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
const write = vi.hoisted(() => vi.fn());
|
const write = vi.hoisted(() => vi.fn());
|
||||||
vi.mock("node:fs", () => ({ promises: { writeFile: write } }));
|
vi.mock("node:fs", async (importOriginal) => {
|
||||||
|
const actual = await importOriginal();
|
||||||
|
return {
|
||||||
|
...actual,
|
||||||
|
existsSync: vi.fn().mockReturnValue(false),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
import { downloadFile, tryDownloadCandidates } from "./download";
|
import { downloadFile, tryDownloadCandidates } from "./download";
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user