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: 
Thank you very much for the replies! Ultimately I had to change where/how `chai.request` was being imported and rewrite the test a good bit. Based on the code in the test you might think 1 or more of the first 5 lines are not necessary, but they *all* are. Assuming the rest api is started up on 3000, the following code works and the test passes.

Am I writing this api request test correctly? I'm just now learning Mocha/Chai so it's probably wrong...

```
import * as chai from 'chai';
import chaiHttp = require('chai-http');
chai.use(chaiHttp);
import { Response } from 'superagent';
import { request, expect } from 'chai';

describe('AppController', () => {
    describe('Route GET /app', () => {
        it('Should GET to /app', async () => {
            const res: Response = await request('http://0.0.0.0:3000').get('/app');
            expect(res).to.have.status(200);
            expect(res).to.be.a('object');
        });
    });

});

```
install from github

```
"devDependencies": {
    "chai-http": "git+https://github.com/chaijs/chai-http.git",
  },

```