{"action":"created","comment":{"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments/109304877","pull_request_review_id":30400556,"id":109304877,"diff_hunk":"@@ -57,62 +51,95 @@ describe('', () => {\n         soon: [1],\n       });\n     });\n+  it('should verify that index has been created', () => {\n+    invertedIndex.createIndex('test.json', test);\n+    expect(Object.keys(invertedIndex.getIndex('test.json', test)).length)\n+      .toBeGreaterThan(0);\n+  });\n+});\n+\n+describe('InvertedIndex : searchIndex', () => {\n+  it('Should return correct index of the search term in work.json', () => {\n+    expect(invertedIndex.searchIndex('soon', 'work.json')).toEqual({\n+      soon: [1],\n+    });\n+  });\n+  it('should return true if the constant is a string', () => {\n+    const words = 'Alice in Wonderland';\n+    expect(Object.keys(invertedIndex.searchIndex(words))).toBeTruthy();\n+  });\n+  it('Should return correct index of the search term', () => {\n+    expect(invertedIndex.searchIndex('humans', 'test.json')).toEqual({\n+      humans: [1],\n+    });\n+  });\n+  it('Should return search for all files', () => {\n+    expect(Object.keys(invertedIndex.searchIndex('soon', 'work.json')))\n+       .toEqual(['soon']);\n+  });\n+  it('should return tokenized words for string in variable words', () => {\n+    let words = 'It CAN only BE++ $$$$$   GOD';\n+    const termsExpected = 'it can only be god';\n+    words = invertedIndex.tokenize(words);\n+    expect(termsExpected).toEqual(words);\n+  });\n });\n \n-describe('', () => {\n-  console.log(invalidBook, typeof invalidBook);\n-  invertedIndex.createIndex('test.json', invalidBook);\n-  it('Should return an object that is an accurate index of the json',\n+\n+describe('InvertedIndex : validateFile', () => {\n+  it('should return truthy if book data is valid',\n     () => {\n-      expect(invertedIndex.getIndex('test.json', invalidBook)).toEqual({\n-        honey: [0],\n-        i: [0],\n-        shrunked: [0],\n-        the: [0],\n-        kids: [0],\n-        an: [0],\n-        american: [0],\n-        movie: [0, 1],\n-        produced: [0],\n-        birds: [0],\n-        ant: [1],\n-        bully: [1],\n-        animated: [1],\n-        epic: [1],\n-        of: [1],\n-        ants: [1],\n-        bullying: [1],\n-        humans: [1],\n-      });\n+      expect(Index.validateFile(workBook).status).toBeTruthy();\n     });\n+  it('should return validate.msg if file uploaded is valid', () => {\n+    expect(Index.validateFile(workBook).msg).toBe('This is a valid File');\n+  });\n+  it('should return falsy if book is not an array of object literals', () => {\n+    expect(Index.validateFile('theDojo').status).toBeFalsy();\n+    expect(Index.validateFile(100).status).toBeFalsy();\n+  });\n+  it('should return validate.msg if file uploaded is empty', () => {\n+    expect(Index.validateFile('Dojo').msg).toBe('File is empty upload a file');\n+    expect(Index.validateFile(100).msg).toBe('File is empty upload a file');\n+  });\n+  it('should return validate.msg if file dosent contain title or text', () => {\n+    expect(Index.validateFile(empty).msg).toBe('Invalid file content');\n+  });\n });\n \n+describe('InvertedIndex : check type of InvertedIndex methods', () => {\n+  it('should check that the class has a createIndex method', () => {\n+    expect(typeof invertedIndex.createIndex).toBe('function');\n+  });\n \n-// describe('Search Index', () => {\n-//   it('Should return correct index of the search term', () => {\n-//     expect(invertedIndex.searchIndex('Testing, soon', work)).toEqual({\n-//       'work.json': {\n-//         testing: [0],\n-//         soon: [1],\n-//       },\n-//     });\n-//   });\n-// });\n-// // Has issues with erasing search words fix before sunday\n-// describe('Search Index', () => {\n-//   it('Should return correct index of the search words', () => {\n-//     expect(invertedIndex.searchIndex('getIndex, Coming', work)).toEqual({\n-//       'work.json': {\n-//         getindex: [0],\n-//         coming: [1],\n-//       },\n-//     });\n-//   });\n-// });\n-\n-// describe('Tokenize Index', () => {\n-//   it('should return tokenized words for tems', () => {\n-//     expect(invertedIndex.tokenize('work.json', work).toEqual());\n-//   });\n-// });\n+  it('should check that the class has a validateFile method', () => {\n+    expect(typeof Index.validateFile).toBe('function');\n+  });\n+\n+  it('should check that the class has a tokenize method', () => {\n+    expect(typeof invertedIndex.tokenize).toBe('function');\n+  });\n \n+  it('should check that the class has a getIndex method', () => {\n+    expect(typeof invertedIndex.getIndex).toBe('function');\n+  });\n+\n+  it('should check that the class has a searchIndex method', () => {","path":"spec/index-spec.js","position":200,"original_position":200,"commit_id":"c0067cdc633e265739a21e1add94879bc95bebaa","original_commit_id":"c0067cdc633e265739a21e1add94879bc95bebaa","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').","created_at":"2017-04-02T09:51:05Z","updated_at":"2017-04-02T09:51:06Z","html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3#discussion_r109304877","pull_request_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments/109304877"},"html":{"href":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3#discussion_r109304877"},"pull_request":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3","id":113811973,"html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3","diff_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3.diff","patch_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3.patch","issue_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/3","number":3,"state":"open","locked":false,"title":"kkk","user":{"login":"andela-fomokaro","id":26232631,"avatar_url":"https://avatars2.githubusercontent.com/u/26232631?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-fomokaro","html_url":"https://github.com/andela-fomokaro","followers_url":"https://api.github.com/users/andela-fomokaro/followers","following_url":"https://api.github.com/users/andela-fomokaro/following{/other_user}","gists_url":"https://api.github.com/users/andela-fomokaro/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-fomokaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-fomokaro/subscriptions","organizations_url":"https://api.github.com/users/andela-fomokaro/orgs","repos_url":"https://api.github.com/users/andela-fomokaro/repos","events_url":"https://api.github.com/users/andela-fomokaro/events{/privacy}","received_events_url":"https://api.github.com/users/andela-fomokaro/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-04-02T09:50:55Z","updated_at":"2017-04-02T09:51:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa58b49297ce6df7046f6c7cbaa780e92a05767","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3/commits","review_comments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3/comments","review_comment_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/3/comments","statuses_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/c0067cdc633e265739a21e1add94879bc95bebaa","head":{"label":"andela-fomokaro:develop","ref":"develop","sha":"c0067cdc633e265739a21e1add94879bc95bebaa","user":{"login":"andela-fomokaro","id":26232631,"avatar_url":"https://avatars2.githubusercontent.com/u/26232631?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-fomokaro","html_url":"https://github.com/andela-fomokaro","followers_url":"https://api.github.com/users/andela-fomokaro/followers","following_url":"https://api.github.com/users/andela-fomokaro/following{/other_user}","gists_url":"https://api.github.com/users/andela-fomokaro/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-fomokaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-fomokaro/subscriptions","organizations_url":"https://api.github.com/users/andela-fomokaro/orgs","repos_url":"https://api.github.com/users/andela-fomokaro/repos","events_url":"https://api.github.com/users/andela-fomokaro/events{/privacy}","received_events_url":"https://api.github.com/users/andela-fomokaro/received_events","type":"User","site_admin":false},"repo":{"id":86061886,"name":"Inverted-Index-Project","full_name":"andela-fomokaro/Inverted-Index-Project","owner":{"login":"andela-fomokaro","id":26232631,"avatar_url":"https://avatars2.githubusercontent.com/u/26232631?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-fomokaro","html_url":"https://github.com/andela-fomokaro","followers_url":"https://api.github.com/users/andela-fomokaro/followers","following_url":"https://api.github.com/users/andela-fomokaro/following{/other_user}","gists_url":"https://api.github.com/users/andela-fomokaro/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-fomokaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-fomokaro/subscriptions","organizations_url":"https://api.github.com/users/andela-fomokaro/orgs","repos_url":"https://api.github.com/users/andela-fomokaro/repos","events_url":"https://api.github.com/users/andela-fomokaro/events{/privacy}","received_events_url":"https://api.github.com/users/andela-fomokaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project","description":null,"fork":false,"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project","forks_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/forks","keys_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/teams","hooks_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/hooks","issue_events_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/events{/number}","events_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/events","assignees_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/assignees{/user}","branches_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/branches{/branch}","tags_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/tags","blobs_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/languages","stargazers_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/stargazers","contributors_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/contributors","subscribers_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/subscribers","subscription_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/subscription","commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/contents/{+path}","compare_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/merges","archive_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/downloads","issues_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues{/number}","pulls_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/labels{/name}","releases_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/releases{/id}","deployments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/deployments","created_at":"2017-03-24T11:39:16Z","updated_at":"2017-03-26T21:42:05Z","pushed_at":"2017-04-02T09:50:56Z","git_url":"git://github.com/andela-fomokaro/Inverted-Index-Project.git","ssh_url":"git@github.com:andela-fomokaro/Inverted-Index-Project.git","clone_url":"https://github.com/andela-fomokaro/Inverted-Index-Project.git","svn_url":"https://github.com/andela-fomokaro/Inverted-Index-Project","homepage":null,"size":528,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela-fomokaro:features","ref":"features","sha":"504542d215a14e986cc5c971ee140ad926e83671","user":{"login":"andela-fomokaro","id":26232631,"avatar_url":"https://avatars2.githubusercontent.com/u/26232631?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-fomokaro","html_url":"https://github.com/andela-fomokaro","followers_url":"https://api.github.com/users/andela-fomokaro/followers","following_url":"https://api.github.com/users/andela-fomokaro/following{/other_user}","gists_url":"https://api.github.com/users/andela-fomokaro/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-fomokaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-fomokaro/subscriptions","organizations_url":"https://api.github.com/users/andela-fomokaro/orgs","repos_url":"https://api.github.com/users/andela-fomokaro/repos","events_url":"https://api.github.com/users/andela-fomokaro/events{/privacy}","received_events_url":"https://api.github.com/users/andela-fomokaro/received_events","type":"User","site_admin":false},"repo":{"id":86061886,"name":"Inverted-Index-Project","full_name":"andela-fomokaro/Inverted-Index-Project","owner":{"login":"andela-fomokaro","id":26232631,"avatar_url":"https://avatars2.githubusercontent.com/u/26232631?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-fomokaro","html_url":"https://github.com/andela-fomokaro","followers_url":"https://api.github.com/users/andela-fomokaro/followers","following_url":"https://api.github.com/users/andela-fomokaro/following{/other_user}","gists_url":"https://api.github.com/users/andela-fomokaro/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-fomokaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-fomokaro/subscriptions","organizations_url":"https://api.github.com/users/andela-fomokaro/orgs","repos_url":"https://api.github.com/users/andela-fomokaro/repos","events_url":"https://api.github.com/users/andela-fomokaro/events{/privacy}","received_events_url":"https://api.github.com/users/andela-fomokaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project","description":null,"fork":false,"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project","forks_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/forks","keys_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/teams","hooks_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/hooks","issue_events_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/events{/number}","events_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/events","assignees_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/assignees{/user}","branches_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/branches{/branch}","tags_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/tags","blobs_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/languages","stargazers_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/stargazers","contributors_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/contributors","subscribers_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/subscribers","subscription_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/subscription","commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/contents/{+path}","compare_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/merges","archive_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/downloads","issues_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues{/number}","pulls_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/labels{/name}","releases_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/releases{/id}","deployments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/deployments","created_at":"2017-03-24T11:39:16Z","updated_at":"2017-03-26T21:42:05Z","pushed_at":"2017-04-02T09:50:56Z","git_url":"git://github.com/andela-fomokaro/Inverted-Index-Project.git","ssh_url":"git@github.com:andela-fomokaro/Inverted-Index-Project.git","clone_url":"https://github.com/andela-fomokaro/Inverted-Index-Project.git","svn_url":"https://github.com/andela-fomokaro/Inverted-Index-Project","homepage":null,"size":528,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3"},"html":{"href":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/3"},"issue":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/3"},"comments":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/c0067cdc633e265739a21e1add94879bc95bebaa"}}}}
{"actor":{"display_login":"houndci-bot"}}