MCPcopy
hub / github.com/qawolf/cli / makeTestFs

Function makeTestFs

src/shell/resolveExport.test.ts:5–16  ·  view source on GitHub ↗
(pkgDir: string, pkg: object)

Source from the content-addressed store, hash-verified

3import { resolveFromEnvDir } from "./resolveExport.js";
4
5function makeTestFs(pkgDir: string, pkg: object): Fs {
6 return {
7 ...makeDefaultFs(),
8 readFileSync: (path: string) => {
9 if (path === `${pkgDir}/package.json`) return JSON.stringify(pkg);
10 throw Object.assign(
11 new Error(`ENOENT: no such file or directory, open '${path}'`),
12 { code: "ENOENT", errno: -2 },
13 );
14 },
15 };
16}
17
18describe("resolveFromEnvDir", () => {
19 const envDir = "/project";

Callers 1

Calls 1

makeDefaultFsFunction · 0.85

Tested by

no test coverage detected