Skip to content

Commit 18140b4

Browse files
committed
test: align fetchUserRepos test with GitHubRepo type fields
1 parent d012b21 commit 18140b4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/github.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,11 @@ describe('fetchUserRepos', () => {
170170
afterEach(() => vi.restoreAllMocks());
171171

172172
it('returns repos data on success', async () => {
173-
vi.mocked(fetch).mockResolvedValue(mockResponse([{ name: 'repo1' }]));
173+
vi.mocked(fetch).mockResolvedValue(
174+
mockResponse([{ stargazers_count: 1, language: 'TypeScript' }])
175+
);
174176
const result = await fetchUserRepos('octocat');
175-
expect(result[0].name).toBe('repo1');
177+
expect(result[0].stargazers_count).toBe(1);
176178
});
177179

178180
it('throws status code error on failure', async () => {

0 commit comments

Comments
 (0)