nodejs-ex/tests/app_test.js

32 lines
711 B
JavaScript
Raw Normal View History

2016-04-11 18:52:20 +00:00
var server = require('../server'),
chai = require('chai'),
chaiHTTP = require('chai-http'),
2016-04-11 18:52:20 +00:00
should = chai.should();
chai.use(chaiHTTP);
reqServer = process.env.HTTP_TEST_SERVER || server
2016-04-11 18:52:20 +00:00
describe('Basic routes tests', function() {
it('GET to / should return 200', function(done){
chai.request(reqServer)
2016-04-11 18:52:20 +00:00
.get('/')
.end(function(err, res) {
res.should.have.status(200);
done();
})
})
it('GET to /pagecount should return 200', function(done){
chai.request(reqServer)
2016-04-11 18:52:20 +00:00
.get('/pagecount')
.end(function(err, res) {
res.should.have.status(200);
done();
})
})
})