You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tests): use mockResolvedValueOnce to prevent mock isolation issues
Fixed test failures in releases-github.test.mts caused by mock leakage
between test suites when running with isolate: false in Vitest.
Root cause:
- Tests used mockResolvedValue() in beforeEach hooks
- With isolate: false, mocks persisted across test suites in shared worker
- Mock data from downloadReleaseAsset leaked into getReleaseAssetUrl tests
- When mocks weren't set up, real httpRequest triggered retry logic (15s)
exceeding the 10s test timeout
Solution:
- Replaced mockResolvedValue() with mockResolvedValueOnce() in each test
- Each test now gets isolated mock implementation
- Removed beforeEach mock setup, keeping only afterEach cleanup
- Tests can now run concurrently without interference
Tests fixed:
- "should get asset URL with exact name" (was timing out after 10s)
- "should get asset URL with wildcard pattern" (was getting wrong mock data)
All 6,248 tests now pass including 37 in releases-github.test.mts.
0 commit comments