Finding
With the vitest include pattern now fixed (PR #19741 changed netlify/functions/__tests__/* to netlify/functions/**/__tests__/*), 4 previously-invisible test failures are now surfacing in netlify/functions/_shared/__tests__/:
Failing tests
| File |
Test |
Error |
analytics-dashboard.test.ts |
sanitizes upstream API errors before throwing |
Expected error pattern doesn't match — gets "Body is unusable: Body has already been..." instead of upstream error |
core-utils.test.ts |
fails closed when append-only blob-backed rate limit operations error |
Object equality mismatch in rate limit response |
fetchWithTimeout.test.ts |
should handle response with various status codes |
Assertion mismatch |
rate-limit.test.ts |
counts paginated blob results across pages |
Object equality mismatch |
Root cause
These tests were written against an earlier API/behavior but have drifted as the production code evolved. Because the vitest include pattern was broken (flat glob excluded _shared/__tests__/), these failures were never caught by CI.
Impact
- 206 tests pass, 4 fail — the test suite is mostly healthy
- These 4 tests need assertions updated to match current code behavior
- Until fixed, any CI run that discovers
_shared/__tests__/ will report failures
Recommendation
- Run
vitest run netlify/functions/_shared/__tests__/ to reproduce
- For each failure, check if the test expectation or the production code needs updating
- Fix assertions to match current behavior (most likely the tests drifted, not the code regressed)
Priority
- Impact: medium (CI noise once include pattern is universally adopted)
- Effort: low (4 assertion fixes)
Filed by quality agent (hold-gated mode)
Finding
With the vitest include pattern now fixed (PR #19741 changed
netlify/functions/__tests__/*tonetlify/functions/**/__tests__/*), 4 previously-invisible test failures are now surfacing innetlify/functions/_shared/__tests__/:Failing tests
analytics-dashboard.test.tscore-utils.test.tsfetchWithTimeout.test.tsrate-limit.test.tsRoot cause
These tests were written against an earlier API/behavior but have drifted as the production code evolved. Because the vitest include pattern was broken (flat glob excluded
_shared/__tests__/), these failures were never caught by CI.Impact
_shared/__tests__/will report failuresRecommendation
vitest run netlify/functions/_shared/__tests__/to reproducePriority
Filed by quality agent (hold-gated mode)