Skip to content

test: improve coverage toward 100%#476

Open
antonisetkowicz wants to merge 1 commit into
fastify:mainfrom
antonisetkowicz:test/improve-coverage
Open

test: improve coverage toward 100%#476
antonisetkowicz wants to merge 1 commit into
fastify:mainfrom
antonisetkowicz:test/improve-coverage

Conversation

@antonisetkowicz

Copy link
Copy Markdown

Summary

Adds tests for previously uncovered code paths, moving overall statement coverage from 97.76% to 98%.

New test cases

Test Covers
base option as single-element array request.js:41-42 — array normalization
HTTP agent close/destroy lifecycle request.js:117-122 — agent cleanup on close
Unsupported body type in HTTP/1 mode request.js:295-296 — error path
Connection header stripping (HTTP/1) request.js:131-136 — RFC 7230 compliance

Remaining gaps to 100%

  • index.js:206UND_ERR_CONNECT_TIMEOUT error handling (requires network timeout simulation)
  • request.js:181BalancedPool origin deletion (requires BalancedPool setup)
  • request.js:199-200 — undici connection header stripping loop (connection headers are removed by undici before reaching this code)

All 164 existing tests + 4 new tests pass. Type tests pass.

Ref #367

Add tests for previously uncovered code paths:
- base option as single-element array normalization (request.js:41-42)
- HTTP agent close/destroy lifecycle (request.js:117-122)
- Unsupported body type error in HTTP/1 mode (request.js:295-296)
- Connection header stripping in HTTP/1 mode (request.js:131-136)

Moves overall coverage from 97.76% to 98%.

Ref fastify#367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant