1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00
Mainflux.mainflux/test/apiTest.js
Drasko DRASKOVIC 2e27375adb Add server.close() in apiTest.js
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2015-11-02 01:49:39 +01:00

41 lines
811 B
JavaScript

/** Chai stuff */
var should = require('chai').should;
var expect = require('chai').expect;
/** Supertest for API */
var supertest = require('supertest');
var server = require('../server');
var api = supertest(server);
/**
* API test description
*/
describe('loading express', function () {
/**
* /status
*/
it('responds to /status', function testSlash(done) {
api
.get('/status')
.expect(200)
.end(function(err, res){
expect(res.body.status).to.equal("running");
done();
});
});
/**
* /foo/bar
*/
it('404 /foo/bar', function testPath(done) {
api
.get('/foo/bar')
.expect(404, done);
});
});
after(function(done) {
server.close(done);
});