Help wanted: split type & runtime tests for openapi-fetch #1852
Labels
enhancement
New feature or request
good first issue
Straightforward problem, solvable for first-time contributors without deep knowledge of the project
openapi-fetch
Relevant to the openapi-fetch library
PRs welcome
PRs are welcome to solve this issue!
For openapi-fetch, most of our tests live in a single
index.test.ts
file. Instead, we should separate them into at least 2:runtime.test.ts
: tests the runtime, such as: Did the correct headers get sent? Did query params serialize correctly? Did the JSON get parsed correctly? Is FormData handled? etctypes.test-d.ts
: basically the bulk of tests: Are we showing required params correctly? Optional params? Are we handlingdata
/error
correctly? What about all the options?The
*.test-d.ts
file uses Vitest type checking and should make more use ofexpectTypeOf()
and other helpers to make more granular assertions. This would help make triaging bugs like #1845, #1798, and #1525 easier.The text was updated successfully, but these errors were encountered: