chaijs / chai-http

HTTP Response assertions for the Chai Assertion Library.
http://chaijs.com/plugins/chai-http
634 stars 113 forks source link

error TS2339: Property 'post' does not exist on type 'Agent' #334

Closed khteh closed 3 months ago

khteh commented 4 months ago

Hit the following errors:

 Exception during run: tests/IntegrationTests/add_students_to_teacher_tests.ts(63,14): error TS2339: Property 'post' does not exist on type 'Agent'.
tests/IntegrationTests/add_students_to_teacher_tests.ts(65,19): error TS7006: Parameter 'err' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(65,24): error TS7006: Parameter 'res' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(105,14): error TS2339: Property 'post' does not exist on type 'Agent'.
tests/IntegrationTests/add_students_to_teacher_tests.ts(107,19): error TS7006: Parameter 'err' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(107,24): error TS7006: Parameter 'res' implicitly has an 'any' type.
    "chai": "^5.1.1",
    "chai-as-promised": "^8.0.0",
    "chai-http": "^5.0.0",
FinnAlexanderWalker commented 3 months ago

Hi! Forgive me if I'm wrong, but I think installing @types/superagent will fix these errors

khteh commented 3 months ago

Yes, this works. Why isn't this highlighted in https://www.chaijs.com/plugins/chai-http/?

FinnAlexanderWalker commented 3 months ago

I have no idea! It would be handy if it was

0xTomDaniel commented 3 weeks ago

Yes, this works. Why isn't this highlighted in https://www.chaijs.com/plugins/chai-http/?

Any maintainers willing to add to documentation?