test: use vi.stubGlobal for global fetch mock

Replace direct global.fetch assignment with vi.stubGlobal for better control and consistency in test setup
This commit is contained in:
bymyself
2026-01-23 20:51:48 -08:00
parent 6b6b467e68
commit 2c6f3028f5

View File

@@ -11,7 +11,7 @@ vi.mock('@/scripts/api', () => ({
}
}))
global.fetch = vi.fn()
vi.stubGlobal('fetch', vi.fn())
describe('refreshRemoteConfig', () => {
const mockConfig = { feature1: true, feature2: 'value' }