Files
compiler-explorer/static
Matt GodboltandClaude 1d8a19455c Add comprehensive tests for HTTP utilities
Added complete test suite for the new HTTP utilities:
- ✅ 27 test cases covering all functions and scenarios
- ✅ Core fetch() wrapper with success/error paths
- ✅ Helper utilities (getJSON, getText, postJSONAndParseResponse)
- ✅ Error filtering and Sentry integration
- ✅ Network vs HTTP error distinction testing
- ✅ executeHttpRequest with callback scenarios
- ✅ Response error handling and fallbacks

Uses vitest-fetch-mock following existing project patterns.
Tests document current behavior and ensure utilities work correctly.

Test Coverage:
- shouldCaptureFetchError() logic verification
- HTTP status code handling (200, 404, 500)
- Network error filtering (TypeError, AbortError)
- JSON parsing and text extraction
- Custom headers and options passthrough
- Error message extraction and fallbacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 08:22:52 -05:00
..
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2025-06-18 09:04:23 -05:00
2025-06-19 08:46:57 -05:00
2025-07-28 10:34:46 -05:00
2025-02-26 02:07:09 +02:00
2025-07-28 10:34:46 -05:00
2025-06-18 09:04:23 -05:00
2025-07-28 10:34:46 -05:00
2025-04-24 12:10:37 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00