Commit c13a4311 authored by Manish Kumar's avatar Manish Kumar
Browse files

Backend tests done

parents 9c19d157 a8e93b2e
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal([1, 2, 3].indexOf(4), -1);
});
});
});
/*describe('User', function() {
describe('#save()', function() {
it('should save without error', function(done) {
var user = new User('Luna');
user.save(function(err) {
if (err) done(err);
else done();
});
});
});
}); async */
\ No newline at end of file
......@@ -4,7 +4,6 @@ var request = require("request");
describe("Server responses?", function() {
describe("Recieving the data", function() {
var url = "http://localhost:3000/checkLogin";
it("returns negative answer of logging", function(done) {
......@@ -19,7 +18,6 @@ describe("Server responses?", function() {
describe("Showing the friend list? ", function() {
var url = "http://localhost:3000/allfriends";
it("returns false status", function(done) {
request.get(url, function(error, response, body) {
var hey = JSON.parse(body);
......@@ -28,4 +26,19 @@ describe("Showing the friend list? ", function() {
});
});
});
describe("Showing pikachu ", function() {
var url = "http://localhost:3000/allpokemon";
it("returns a pokemon", function(done) {
request(url, function(error, res, body) {
var hey = JSON.parse(body)
expect(hey[24]).to.be.an('object').that.deep.includes({pokeName: 'pikachu'});
if (error) {
return console.error('this failed:', error);
}
done();
});
});
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment