I have a Typscript app and API. I wrote the below test per numerous Google searches and some examples found here on SO and other places. I see no issue in the test code. Googling TypeError: chai.request is not a function
, so far is getting me now where. Do you see my error below?
Thank you, thank you, thank you for any help :-)
I solved this by the following approach (Express.js with TypeScript)
import chai from 'chai';
import chaiHttp from 'chai-http';
chai.use(chaiHttp);
Hope it helps.
Remember to install @types/chai and other type definition packages for the block above to work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With