CodeVetter · Repo Unpack · Testing signals
unjs/ofetch
Tests and CI were inspected, not executed; no passing result or measured coverage is established. The inspected Vitest suite primarily exercises native fetch against a local H3 server. Coverage spans serialization, decoding, headers, errors, hooks, retries, and timeout behavior, with some assertions narrower than their titles imply. This is a bounded inventory rather than exhaustive behavioral assurance.
- test/index.test.ts uses Vitest, a global fetch spy, and an H3 server bound to an ephemeral localhost port, with lifecycle setup and teardown.
- Decoding tests cover custom parseResponse, explicit JSON/blob/text/arrayBuffer selection, binary Blob detection, 204, and HEAD.
- Payload tests cover object/array serialization, header representations, string and Buffer bodies, web/Node streams, FormData, and URLSearchParams.
- Error/default tests assert 404 error context and parsed body, ignoreResponseError, header/query precedence, and Request header overrides.
- Retry-delay tests compare competing requests by Promise.race; abort tests assert rejection, and timeout tests assert relative completion and timeout cause fields rather than exact retry counts.
- Hook tests assert propagation of exceptions from all four hooks and callback counts for successful/error responses with single hooks and arrays.
- The inspected suite's final options test contacts jsonplaceholder; it does not establish SSE, proxy/TLS, malformed-JSON, fragment handling, or streamed-body replay coverage.
- Inspected configuration enables V8 coverage with src inclusion and text/clover/json reporters; CI declares Node 20/22/24 lint, build, coverage, and Codecov without a browser or worker job.