# Testing signals — unjs/ofetch

> Canonical page: https://codevetter.com/unpack/ofetch/testing-signals

# Testing signals — unjs/ofetch

Scanned commit 1dbc37fd1ceab832fc7c90cad81b1091c95ba563 (2026-07-08). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

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. — [test/index.test.ts#L1-L22](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L1-L22) [test/index.test.ts#L67-L76](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L67-L76)
- Decoding tests cover custom parseResponse, explicit JSON/blob/text/arrayBuffer selection, binary Blob detection, 204, and HEAD. — [test/index.test.ts#L82-L111](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L82-L111) [test/index.test.ts#L253-L261](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L253-L261)
- Payload tests cover object/array serialization, header representations, string and Buffer bodies, web/Node streams, FormData, and URLSearchParams. — [test/index.test.ts#L119-L159](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L119-L159) [test/index.test.ts#L161-L231](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L161-L231)
- Error/default tests assert 404 error context and parsed body, ignoreResponseError, header/query precedence, and Request header overrides. — [test/index.test.ts#L234-L250](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L234-L250) [test/index.test.ts#L347-L397](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L347-L397)
- 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. — [test/index.test.ts#L270-L310](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L270-L310) [test/index.test.ts#L324-L344](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L324-L344)
- Hook tests assert propagation of exceptions from all four hooks and callback counts for successful/error responses with single hooks and arrays. — [test/index.test.ts#L400-L435](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L400-L435) [test/index.test.ts#L438-L505](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L438-L505)
- 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. — [test/index.test.ts#L508-L525](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/test/index.test.ts#L508-L525) [src/fetch.ts#L72-L75](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L72-L75) [src/fetch.ts#L215-L230](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L215-L230) [src/utils.url.ts#L69-L102](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/utils.url.ts#L69-L102)
- 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. — [vitest.config.ts#L3-L9](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/vitest.config.ts#L3-L9) [package.json#L22-L26](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/package.json#L22-L26) [.github/workflows/ci.yml#L7-L19](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/.github/workflows/ci.yml#L7-L19)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
