Saturday, 13 May 2017

chai.request doesn't work

i want to run a simple test with mocha and chai and chai http

this is the test i want to run

'use strict';
var chai = require('chai');
var chaiHttp = require('chai-http');
var should = chai.should();
var server = require('../app');
chai.use(chaiHttp);
describe('/GET', () => {
    it('returns the homepage', (done) => {
        chai.request(server).get('/').end(err, res) => {
            res.should.have.status(200);
            done();
        }
    })
})

this is the error i get enter image description here



via Hachimi Ahmed Amine

No comments:

Post a Comment