add test
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
4ba52d63ca
commit
b8c12aadcd
@ -0,0 +1,15 @@
|
|||||||
|
before(function(done) {
|
||||||
|
this.timeout(0);
|
||||||
|
var app = app || require("../app");
|
||||||
|
|
||||||
|
global.app = app;
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
after(function(done) {
|
||||||
|
console.log();
|
||||||
|
console.log("--------------------");
|
||||||
|
console.log("Test Completely!!");
|
||||||
|
console.log("--------------------");
|
||||||
|
done();
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
--timeout 500000
|
||||||
|
--require should
|
||||||
|
--reporter spec
|
||||||
|
--ui bdd
|
||||||
|
--recursive ./app.js
|
@ -0,0 +1,8 @@
|
|||||||
|
const assert = require("assert");
|
||||||
|
describe("Array", () => {
|
||||||
|
describe("#indexOf()", () => {
|
||||||
|
it("should return -1 when the value is not present", function() {
|
||||||
|
assert.equal(-1, [1, 2, 3].indexOf(4));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,28 @@
|
|||||||
|
require("../bootstrap");
|
||||||
|
|
||||||
|
const should = require("should");
|
||||||
|
const request = require("supertest");
|
||||||
|
|
||||||
|
describe("Test Index,", () => {
|
||||||
|
it("Should get 200 response.", done => {
|
||||||
|
request(app)
|
||||||
|
.get("/")
|
||||||
|
.expect(200)
|
||||||
|
.expect("Content-Type", /html/)
|
||||||
|
.end(done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("GET /users", () => {
|
||||||
|
it("respond with json", done => {
|
||||||
|
request(app)
|
||||||
|
.get("/user")
|
||||||
|
.set("Accept", "application/json")
|
||||||
|
.expect(200)
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.end((err, res) => {
|
||||||
|
if (err) return done(err);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in new issue