import axios from 'axios'; import changelogAPI from '../changelog'; vi.mock('axios'); describe('#changelogAPI', () => { beforeEach(() => { vi.clearAllMocks(); vi.stubGlobal('fetch', vi.fn().mockResolvedValue({})); axios.get.mockResolvedValue({ data: { posts: [] } }); }); afterEach(() => { vi.unstubAllGlobals(); }); it('returns an empty local feed without making a request', async () => { const response = await changelogAPI.fetchFromHub(); expect(response).toEqual({ data: { posts: [] } }); expect(global.fetch).not.toHaveBeenCalled(); expect(axios.get).not.toHaveBeenCalled(); }); });