MCPcopy
hub / github.com/yarnpkg/yarn / GitMock

Class GitMock

__tests__/util/git/git-ref-resolver.js:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import {resolveVersion, isCommitSha, parseRefs} from '../../../src/util/git/git-ref-resolver.js';
6
7class GitMock implements GitRefResolvingInterface {
8 resolveDefaultBranch(): Promise<ResolvedSha> {
9 return Promise.resolve({sha: '8a41a314e23dc566a6b7e73c757a10d13e3320cf', ref: 'refs/heads/main'});
10 }
11 resolveCommit(sha: string): Promise<?ResolvedSha> {
12 if (sha.startsWith('003ae60')) {
13 return Promise.resolve({sha: '003ae6063f23a4184736610361f14438a3257c83', ref: undefined});
14 }
15 return Promise.resolve(null);
16 }
17}
18
19test('resolveVersion', async () => {
20 const config = await Config.create();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…