Question: 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 :-)

[![enter image description here](https://i.stack.imgur.com/A6rVF.png)](https://i.stack.imgur.com/A6rVF.png)

Answer: 
I can reproduce the problem if I enable the `esModuleInterop` compiler option. When this option is enabled, `import * as chai from 'chai';` only imports the members that the `chai` module has at the time it is imported. Indeed, I believe it's considered dodgy to add exports to an ES module at runtime. Try `import chai from 'chai';` or `import chai = require('chai');` instead; either one is working for me.
I can reproduce the issue on my own machine. This is how I solve it. 

```
import * as chai from 'chai';
import chaiHttp = require('chai-http');

chai.use(chaiHttp);

```

I also need to install **@types/chai-http** so the compiler knows.

```
npm install @types/chai-http --save-dev

```

Hope it helps