2020-03-23 13:18:50 +00:00
|
|
|
const chai = require("chai");
|
|
|
|
const chaiHttp = require("chai-http");
|
2020-03-05 17:40:44 +00:00
|
|
|
|
2020-03-23 13:18:50 +00:00
|
|
|
const app = require("../src/server");
|
2020-03-05 17:40:44 +00:00
|
|
|
|
|
|
|
chai.use(chaiHttp);
|
|
|
|
chai.should();
|
|
|
|
|
2020-03-23 13:18:50 +00:00
|
|
|
describe("API /healthz", () => {
|
|
|
|
it("it should return 200", done => {
|
|
|
|
chai
|
|
|
|
.request(app)
|
|
|
|
.get("/healthz")
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
2020-03-05 17:40:44 +00:00
|
|
|
});
|
|
|
|
|
2020-03-23 13:18:50 +00:00
|
|
|
describe("API /", () => {
|
|
|
|
it("it should return Welcome message", done => {
|
|
|
|
chai
|
|
|
|
.request(app)
|
|
|
|
.get("/")
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200);
|
|
|
|
res.should.to.be.html;
|
|
|
|
res.text.should.be.equal("Hello Docker World\n");
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
2020-03-05 17:40:44 +00:00
|
|
|
});
|