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: 
You are mixing `import` and `require` syntax, it's a bad idea!

Use only `import` syntax :

```
import * as chai from 'chai';
import * as chai-http from 'chai-http';

chai.use(chai-http);

```

**Edit**

Unfortunately, it seems that the es6 module syntax is not supported in chai-http. You can see the issue [here](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19480)

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

chai.use(chai-http);

```
Use :

```
const chai =require('chai');
const chaiHttp = require('chai-http');
chai.use(chaiHttp);

```

Then use

```
describe('Chat', () => {
it('should return all data',async()=>{
            chai.request("https://google.com")
            .get('/')
            .end((err, res) => {
             expect(res).to.have.status(200);
             done();
             });
        })
 })

```