Skip to content

Instantly share code, notes, and snippets.

@sombriks
Created November 23, 2016 05:47
Show Gist options
  • Save sombriks/49bf54a715be7d53c9b89ed6b6da679d to your computer and use it in GitHub Desktop.
Save sombriks/49bf54a715be7d53c9b89ed6b6da679d to your computer and use it in GitHub Desktop.
well it works. mocha + chai + chai-http
/*
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.1.2",
"chai-http": "^3.0.0"
}
*/
"use strict"
let chai = require('chai');
let chaiHttp = require('chai-http');
let server = require('../src/main');
let should = chai.should();
chai.use(chaiHttp);
describe("Basic tests", () => {
it("it should get the app status", (done) => {
chai.request(server.app)
.get('/status')
.end((err, res) => {
res.should.have.status(200);
res.text.should.be.eql("ONLINE");
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment