# Testing signals — sindresorhus/got

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

# Testing signals — sindresorhus/got

Scanned commit e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4 (2026-09-20). 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 asserted. The inspected suite uses AVA, TypeScript assertions, local HTTP servers, and selected fake timers. Regression cases exercise transport identity, cross-origin behavior, buffering, caching, retries, and timeout budgets. The inventory is bounded, and explicit skipped or expected-failing cases limit what test presence establishes.
- AVA runs test/* excluding *.types.ts, treats TypeScript as modules, uses a ten-minute timeout, and disables worker threads; the script first runs XO and tsc --noEmit with tsx supplying ESM execution support. — [package.json#L17-L19](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L17-L19) [package.json#L107-L116](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L107-L116)
- withServer creates a real HTTP server, optionally installs fake timers, builds a Got instance with that server's prefixUrl, and closes the server in finally; maintainer.md explicitly discourages nock because of process-wide interception. — [test/helpers/with-server.ts#L22-L39](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/helpers/with-server.ts#L22-L39) [test/helpers/with-server.ts#L49-L78](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/helpers/with-server.ts#L49-L78) [maintainer.md#L3-L5](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/maintainer.md#L3-L5)
- Promise tests assert request/response events, raw Uint8Array behavior with decompression disabled, and abort propagation through .json(); extend.types.ts checks inferred instance/default merges using expect-type under TypeScript checking. — [test/promise.ts#L9-L50](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/promise.ts#L9-L50) [test/promise.ts#L66-L99](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/promise.ts#L66-L99) [test/extend.types.ts#L20-L49](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/extend.types.ts#L20-L49) [tsconfig.json#L13-L17](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/tsconfig.json#L13-L17)
- Cross-origin regressions distinguish POST 302 body removal from 307 body preservation with credential stripping; pagination tests check authorization removal and rejection of absolute Link URLs or in-place origin mutations. — [test/redirects.ts#L933-L947](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/redirects.ts#L933-L947) [test/redirects.ts#L1287-L1308](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/redirects.ts#L1287-L1308) [test/pagination.ts#L807-L836](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/pagination.ts#L807-L836) [test/pagination.ts#L1453-L1495](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/pagination.ts#L1453-L1495)
- Retry tests assert a consumed generator produces only one upload and a replay error; request-timeout tests cover slow redirects, stalled downloads/uploads, and the intentional exclusion of initial beforeRequest hook time. — [test/retry.ts#L1863-L1892](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/retry.ts#L1863-L1892) [test/request-timeout.ts#L15-L46](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/request-timeout.ts#L15-L46) [test/request-timeout.ts#L71-L96](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/request-timeout.ts#L71-L96) [test/request-timeout.ts#L113-L128](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/request-timeout.ts#L113-L128)
- Transport tests assert HTTP/2 pooled-socket reuse and separation by checkServerIdentity function identity; DnsCache tests inject resolvers to verify answer reuse and requested IPv4-family selection. — [test/https.ts#L2548-L2564](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/https.ts#L2548-L2564) [test/https.ts#L2594-L2619](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/https.ts#L2594-L2619) [test/dns-cache.ts#L45-L90](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/dns-cache.ts#L45-L90)
- Cache tests assert cacheable GET/POST reuse, QUERY bypass, 304 refresh of existing metadata, and uncached native FormData/Web-stream uploads; a separate test.failing documents missing new metadata from 304 responses. — [test/cache.ts#L35-L73](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/cache.ts#L35-L73) [test/cache.ts#L1053-L1100](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/cache.ts#L1053-L1100) [test/cache.ts#L1327-L1366](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/cache.ts#L1327-L1366)
- Inspection identified a skipped unhandled-body-error test and an expected-failing cache case; CI specifies Ubuntu Node 22/24/26 and npm test, while coverage is a separate c8 script with text/HTML/lcov output and is not invoked by the inspected workflow. — [test/stream.ts#L929-L939](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/stream.ts#L929-L939) [test/cache.ts#L1082-L1100](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/test/cache.ts#L1082-L1100) [.github/workflows/main.yml#L13-L26](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/.github/workflows/main.yml#L13-L26) [package.json#L18-L19](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L18-L19) [package.json#L118-L127](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L118-L127)

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)
