{"action":"created","comment":{"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments/109232917","pull_request_review_id":30326881,"id":109232917,"diff_hunk":"@@ -0,0 +1,128 @@\n+const Index = require('../Model/inverted-index.js');\n+const test = require('../files/test.json');\n+const work = require('../files/work.json');\n+const empty = require('../files/empty.json');\n+\n+const invertedIndex = new Index();\n+\n+const workBook = [{\n+  title: 'Checkpoint one',\n+  text: 'Testing getIndex function',\n+},\n+\n+{\n+  title: 'Checkpoint Two',\n+  text: 'Coming soon',\n+},\n+];\n+describe('InvertedIndex : define methods', () => {\n+  invertedIndex.createIndex('work.json', workBook);\n+  it('Should ensure that invertedIndex methods are defined', () => {\n+    expect(invertedIndex.getIndex).toBeDefined();\n+    expect(invertedIndex.createIndex).toBeDefined();\n+    expect(invertedIndex.tokenize).toBeDefined();\n+    expect(Index.validateFile).toBeDefined();\n+    expect(invertedIndex.searchIndex).toBeDefined();\n+    expect(invertedIndex.flattenSearch).toBeDefined();\n+  });\n+});\n+\n+describe('InvertedIndex : createIndex', () => {\n+  invertedIndex.createIndex('work.json', workBook);\n+  it('should verify that index has been created', () => {\n+    expect(Object.keys(invertedIndex.getIndex('work.json', workBook)).length)\n+      .toBeGreaterThan(0);\n+  });\n+  it('Should return an object that is an accurate index of the file uploaded',\n+    () => {\n+      expect(invertedIndex.getIndex('work.json', workBook)).toEqual({\n+        checkpoint: [0, 1],\n+        one: [0],\n+        testing: [0],\n+        getindex: [0],\n+        function: [0],\n+        two: [1],\n+        coming: [1],\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('Testing, soon', 'work.json')).toEqual({\n+      testing: [0],\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('Honey, humans', 'test.json')).toEqual({\n+      honey: [0],\n+      humans: [1],\n+    });\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+\n+describe('InvertedIndex : validateFile', () => {\n+  it('should return truthy if book data is valid',\n+    () => {\n+      expect(Index.validateFile(workBook).status).toBeTruthy();\n+    });\n+  it('should return validate.msg if file uploaded is valid', () => {","path":"spec/index-spec.js","position":87,"original_position":87,"commit_id":"c2cdf73725f555c7a7230b59edecd3d796b5548a","original_commit_id":"c2cdf73725f555c7a7230b59edecd3d796b5548a","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-03-31T19:21:55Z","updated_at":"2017-03-31T19:21:56Z","html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2#discussion_r109232917","pull_request_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/comments/109232917"},"html":{"href":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2#discussion_r109232917"},"pull_request":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2","id":112647547,"html_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2","diff_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2.diff","patch_url":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2.patch","issue_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/2","number":2,"state":"open","locked":false,"title":"compare develop branch with master branch","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-03-26T22:21:22Z","updated_at":"2017-03-31T19:21:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"728698b49fab4b0869a7e640bf3cfbffab005c2b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2/commits","review_comments_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2/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/2/comments","statuses_url":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/c2cdf73725f555c7a7230b59edecd3d796b5548a","head":{"label":"andela-fomokaro:develop","ref":"develop","sha":"c2cdf73725f555c7a7230b59edecd3d796b5548a","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-03-31T19:21:46Z","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":520,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela-fomokaro:master","ref":"master","sha":"a05385eb059ae61e7b3db02db9a1bdae8b2815dc","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-03-31T19:21:46Z","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":520,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2"},"html":{"href":"https://github.com/andela-fomokaro/Inverted-Index-Project/pull/2"},"issue":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/2"},"comments":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/pulls/2/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/2/commits"},"statuses":{"href":"https://api.github.com/repos/andela-fomokaro/Inverted-Index-Project/statuses/c2cdf73725f555c7a7230b59edecd3d796b5548a"}}}}
{"actor":{"display_login":"houndci-bot"}}