Skip to content

Commit

Permalink
import fs statically
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed May 17, 2024
1 parent 6d8c6d2 commit 015fe08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/utils/npm-utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 015fe08

Please sign in to comment.