Angular Project

This commit is contained in:
Igor 2019-11-23 15:56:40 +01:00
parent d34f156ffa
commit e93e83b6b8
1 changed files with 26 additions and 0 deletions

26
test/test.js Normal file
View File

@ -0,0 +1,26 @@
var supertest = require("supertest");
var should = require("should");
// This agent refers to PORT where the program is running.
var server = supertest.agent("http://localhost:4000");
// UNIT test begin
describe("SAMPLE unit test",function(){
// #1 should return home page
it("should return home page",function(done){
// calling home page
server
.get("/")
.expect("Content-type",/text/)
.expect(200) // THis is HTTP response
.end(function(err,res){
// HTTP status should be 200
res.status.should.equal(200);
done();
});
});
});