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

Function fakeClient

packages/computer/src/git/cli.test.ts:124–353  ·  view source on GitHub ↗
(
  overrides: Partial<GitClient> = {},
  fakes: {
    status?: () => StatusEntry[];
    log?: () => CommitView[];
    show?: () => CommitView;
    revParse?: () => string;
    repoRoot?: () => string;
    diffSummary?: () => import("./diff.js").DiffSummaryEntry[];
    currentBranch?: () => string | undefined;
    lsFiles?: () => string[];
    lsTree?: () => TreeEntryView[];
    branchList?: () => string[];
    tagList?: () => string[];
    push?: () => PushResult;
    merge?: () => MergeResult;
    fetch?: () => FetchResult;
    remoteList?: () => RemoteView[];
    hashObject?: () => string;
    catFile?: () => CatFileResult;
    configGet?: () => string | string[] | undefined;
    stashList?: () => string[];
    clean?: () => string[];
  } = {},
)

Source from the content-addressed store, hash-verified

122}
123
124function fakeClient(
125 overrides: Partial<GitClient> = {},
126 fakes: {
127 status?: () => StatusEntry[];
128 log?: () => CommitView[];
129 show?: () => CommitView;
130 revParse?: () => string;
131 repoRoot?: () => string;
132 diffSummary?: () => import("./diff.js").DiffSummaryEntry[];
133 currentBranch?: () => string | undefined;
134 lsFiles?: () => string[];
135 lsTree?: () => TreeEntryView[];
136 branchList?: () => string[];
137 tagList?: () => string[];
138 push?: () => PushResult;
139 merge?: () => MergeResult;
140 fetch?: () => FetchResult;
141 remoteList?: () => RemoteView[];
142 hashObject?: () => string;
143 catFile?: () => CatFileResult;
144 configGet?: () => string | string[] | undefined;
145 stashList?: () => string[];
146 clean?: () => string[];
147 } = {},
148): {
149 client: GitClient;
150 calls: FakeCalls;
151} {
152 const calls: FakeCalls = {
153 clone: [],
154 diff: [],
155 diffSummary: [],
156 init: [],
157 status: [],
158 add: [],
159 rm: [],
160 commit: [],
161 log: [],
162 show: [],
163 revParse: [],
164 repoRoot: [],
165 currentBranch: [],
166 lsFiles: [],
167 lsTree: [],
168 branch: [],
169 branchDelete: [],
170 branchList: [],
171 tag: [],
172 tagDelete: [],
173 tagList: [],
174 checkout: [],
175 fetch: [],
176 push: [],
177 pull: [],
178 merge: [],
179 remoteAdd: [],
180 remoteRemove: [],
181 remoteList: [],

Callers 1

cli.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected