From baa6d32c03365d5c3610a3306f5d95d9613464c4 Mon Sep 17 00:00:00 2001 From: kishan Date: Fri, 22 Feb 2019 23:44:03 +0530 Subject: [PATCH] Added some test --- feedreader.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/feedreader.js b/feedreader.js index 16c7738..ba3d931 100644 --- a/feedreader.js +++ b/feedreader.js @@ -24,7 +24,7 @@ $(function () { it('are defined', function () { let expect = chai.expect; expect(allFeeds).to.not.be.undefined; - expect(allFeeds.length).to.be.above(0); + expect(allFeeds.length).to.be.above(3); }); @@ -32,12 +32,22 @@ $(function () { it('should have defined Urls', function () { // Test here + let expect = chai.expect; + allFeeds.forEach((feeds) => { + expect(feeds.url).to.not.be.undefined; + }); + }); // This test check whether all the feed names are defined and are not empty. it('should have defined names', function () { // Test here + let expect = chai.expect; + allFeeds.forEach((feeds) => { + expect(feeds.name).to.not.be.undefined; + }); + }); }); @@ -62,6 +72,11 @@ $(function () { // Test to check the entries are not empty. it(`should not be empty for feeds`, (done) => { + let expect=chai.expect; + loadFeed(0,(result,status) => { + expect(status).to.be.equal("success"); + return done(); + }); done(); }) })