MCPcopy Create free account
hub / github.com/cloudflare/computer / fakeFs

Function fakeFs

packages/computer/src/runtime/capability.test.ts:5–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import type { WorkspaceRuntimeFilesystem } from "./types.js";
4
5function fakeFs(): WorkspaceRuntimeFilesystem {
6 return {
7 readFile: vi.fn() as unknown as WorkspaceRuntimeFilesystem["readFile"],
8 stat: vi.fn().mockResolvedValue({ size: 0 }),
9 lstat: vi.fn().mockResolvedValue({ isSymbolicLink: false }),
10 readlink: vi.fn(),
11 readdir: vi.fn().mockResolvedValue([]),
12 find: vi.fn().mockResolvedValue([]),
13 ls: vi.fn().mockResolvedValue([]),
14 grep: vi.fn().mockResolvedValue([]),
15 writeFile: vi.fn(),
16 mkdir: vi.fn(),
17 rm: vi.fn(),
18 chmod: vi.fn(),
19 symlink: vi.fn(),
20 };
21}
22
23describe("WorkspaceRuntimeCapability", () => {
24 it("resolves relative and absolute paths under its root", () => {

Callers 1

capability.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected