get chai request 28 29

Solutions on MaxInterview for get chai request 28 29 by the best coders in the world

showing results for - "get chai request 28 29"
Ryan
03 Apr 2016
1it('fails, as expected', function(done) { // <= Pass in done callback
2  chai.request('http://localhost:8080')
3  .get('/')
4  .end(function(err, res) {
5    expect(res).to.have.status(123);
6    done();                               // <= Call done to signal callback end
7  });
8});
9
10it('succeeds silently!', function() {   // <= No done callback
11  chai.request('http://localhost:8080')
12  .get('/')
13  .end(function(err, res) {
14    expect(res).to.have.status(123);    // <= Test completes before this runs
15  });
16});
17