title: Mocha Unit Testing: Uncaught TypeError: Cannot read property 'apply' of undefined
body: <p>I want to write unit testing for Restful Endpoint, but whenever I run npm test. I get the error  Uncaught TypeError: Cannot read property 'apply' of undefined .</p>
  <pre><code>let chai = require('chai')
  let chaiHttp = require('chai-http')
  let home = require('../routes/home')
  let user = require('../routes/users')
  //Assertion Style
  chai.should()
  
  chai.use(chaiHttp)
  
  describe('chow Api', () =&gt; {
    //  users
      describe(&quot;GET /api/chow/home&quot;, () =&gt; {
          it('it should render Welcome to Homepage', (done) =&gt;{
              chai.request(home)
              .get(&quot;/api/chow/home&quot;)
              .end((err, response) =&gt;{
                  response.should.have.status(200)
                  response.body.should.be('string')
                  done()
              })
          })
      })
  
      describe('GET /api/chow/users', () =&gt; {
          it('it should GET all the users', (done) =&gt; {
              chai.request(user)
              .get(&quot;/api/chow/users&quot;)
              .end((err, response) =&gt;{
                  response.should.have.status(200)
                  response.should.be.a('array')
                  done()
              })
          })
      })
  })
  </code></pre>