Skip to content

[quality] 4 pre-existing test failures now visible after vitest include pattern fix #19745

Description

@clubanderson

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

  1. Run vitest run netlify/functions/_shared/__tests__/ to reproduce
  2. For each failure, check if the test expectation or the production code needs updating
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.qualitytesting

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions