Member-only story
error TS2339: Property ‘get’ does not exist on type ‘Agent’ (Chai-Http, TypeScript, Mocha)
This TypeScript error was about to get annoying, I wanted to continue writing test cases using Chai-Http as it supposedly should go rather well with the Chai assertion library.
With several other HTTP client libraries, including Node Fetch, also being available and feasible options for use in the tests, it would be good if the Chai-Http usage would be a bit easier to get going smoothly, as it does offer specific support for creating assertions on the HTTP backend behaviour.
However, the test code started to get crowded with all the @ts-expect-error
annotations as the Chai-Http introduced functions were not being recognized as part of the types.

The Agent was said not to have the get() function and also the types for the Promise.then() callback function parameters were undetected.
Exception during run: test/chai-http.spec.ts(18,5): error TS2339: Property 'get' does not exist on type 'Agent'.
test/chai-http.spec.ts(19,11): error TS7006: Parameter 'res' implicitly has an 'any' type.
I did have all the necessary packages installed:
- chai
- @types/chai
- chai-http
- @types/chai-http