1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-05-09 19:29:29 +08:00
Mainflux.mainflux/test/apiTest.js
Drasko DRASKOVIC 5e31f45b27 Add Mocha, Chai and Supertest combo for testing
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2015-11-01 03:43:23 +01:00

36 lines
754 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);
});
});