chore: fix eslint errors introduced in phase 4 backend
This commit is contained in:
@@ -8,9 +8,9 @@ import {
|
||||
|
||||
describe('resolveBranchHead', () => {
|
||||
it('returns the branch tip sha from the branch ref', async () => {
|
||||
const getBranch = vi.fn(async () => ({
|
||||
data: { commit: { sha: 'deadbeef' } },
|
||||
}));
|
||||
const getBranch = vi.fn(() =>
|
||||
Promise.resolve({ data: { commit: { sha: 'deadbeef' } } }),
|
||||
);
|
||||
const octokit = {
|
||||
rest: { repos: { getBranch } },
|
||||
} as unknown as Octokit;
|
||||
@@ -45,24 +45,22 @@ describe('compareAcrossForkNetwork', () => {
|
||||
makeCommit(i === 49 ? 'LAST_COMMIT_NOT_TIP' : `c${100 + i}`),
|
||||
);
|
||||
|
||||
const compareCommitsWithBasehead = vi.fn(
|
||||
async ({ page }: { page?: number }) => {
|
||||
const commits = page === 2 ? page2 : page1;
|
||||
return {
|
||||
data: {
|
||||
total_commits: 150,
|
||||
ahead_by: 150,
|
||||
merge_base_commit: { sha: 'MERGE_BASE' },
|
||||
base_commit: { sha: 'BASE' },
|
||||
html_url: 'https://github.com/o/r/compare/base...head',
|
||||
commits,
|
||||
},
|
||||
};
|
||||
},
|
||||
const compareCommitsWithBasehead = vi.fn(({ page }: { page?: number }) => {
|
||||
const commits = page === 2 ? page2 : page1;
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
total_commits: 150,
|
||||
ahead_by: 150,
|
||||
merge_base_commit: { sha: 'MERGE_BASE' },
|
||||
base_commit: { sha: 'BASE' },
|
||||
html_url: 'https://github.com/o/r/compare/base...head',
|
||||
commits,
|
||||
},
|
||||
});
|
||||
});
|
||||
const getBranch = vi.fn(() =>
|
||||
Promise.resolve({ data: { commit: { sha: 'TIP' } } }),
|
||||
);
|
||||
const getBranch = vi.fn(async () => ({
|
||||
data: { commit: { sha: 'TIP' } },
|
||||
}));
|
||||
const octokit = {
|
||||
rest: { repos: { compareCommitsWithBasehead, getBranch } },
|
||||
} as unknown as Octokit;
|
||||
|
||||
Reference in New Issue
Block a user