fix flaky tests

This commit is contained in:
tanzhenxin 2025-12-23 14:50:47 +08:00
parent 955547d523
commit 10a0c843c1
2 changed files with 22 additions and 0 deletions

View file

@ -41,6 +41,17 @@ vi.mock('simple-git', () => ({
}),
}));
vi.mock('../extensions/github.js', async (importOriginal) => {
const actual =
await importOriginal<typeof import('../extensions/github.js')>();
return {
...actual,
downloadFromGitHubRelease: vi
.fn()
.mockRejectedValue(new Error('Mocked GitHub release download failure')),
};
});
vi.mock('os', async (importOriginal) => {
const mockedOs = await importOriginal<typeof os>();
return {