{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/comments/63966025","id":63966025,"diff_hunk":"@@ -0,0 +1,62 @@\n+/* Welcome to an intro to testing! This practice module\n+    will allow you to become familiar with testing concepts.\n+    We test to check the I/O of our apps. That is - we are not\n+    checking for HOW something works, but the end RESULT and\n+    state of a particular place in our application.\n+*/\n+\n+\n+/* Below is a basic example of a test \"framework\" where\n+    our test is a function that we can reuse to check against\n+    different components of our application.\n+    The `!expression` may look odd - we test for failing\n+    functionality first to then refactor the test to pass.\n+    This is common practice in testing ('red-green' refactoring).\n+*/\n+function expect(expression, failureMessage, successMessage) {\n+  if (!expression) {\n+    console.log('test failed:', failureMessage);\n+    return;\n+  }\n+  console.log('test passed:', successMessage);\n+}\n+\n+/* Below is an example of our test in action. Run this file in node\n+    to see what happens when the test fails, then change `ricksFaveAnimal`\n+    to get the test to pass!\n+*/\n+var ricksFaveAnimal = 'heyena';\n+\n+expect(\n+  ricksFaveAnimal === 'penguin',\n+  'ricksFavoriteAnimal should equal penguin, but currently equals ' + ricksFaveAnimal,\n+  'ricksFavoriteAnimal equals penguin!');\n+\n+  // BEGIN WORK BELOW - test code by running `node bonus-testing-part-one.js`\n+  //  in your terminal!\n+\n+  /* ========================================================================\n+  ------------------------- Favorite Animals --------------------------------\n+  ===========================================================================\n+   The zoo is closing in 20 minutes. You still haven't seen your four favorite\n+   animals. You only have time for one. How do you choose just one?!\n+  */\n+\n+var favoriteAnimals = ['elephants', 'penguins', 'eagles', 'camels'];\n+var nextAnimal;\n+\n+  /* TODO:\n+      Assign one of your favorite animals dynamically by chance to the\n+      nextAnimal variable   :-)\n+      Your code begins on the next line: */\n+nextAnimal = favoriteAnimals[Math.floor(Math.random()*favoriteAnimals.length)];\n+\n+\n+  /* TODO:\n+      Write a test! Use the `expect()` function we defined earlier to ensure\n+      that an element in the favoriteAnimals array was assigned to nextAnimal.\n+      No hard-coded results allowed! (ex: seeing if nextAnimal is equal to\n+      just 'penguin').\n+      Remember to: pass in your expression, and write a failure and a success\n+      message. Your test begins on the next line: */\n+expect( favoriteAnimals.indexOf(nextAnimal) !== -1, nextAnimal + ' was not found in the array: [' + favoriteAnimals.join(', ') + '].', nextAnimal + ' was found in the array: [' + favoriteAnimals.join(', ') + '] at position ' + favoriteAnimals.indexOf(nextAnimal) );","path":"submissions/derek/bonus-testing-part-one.js","position":62,"original_position":62,"commit_id":"6841c8e7e9602f8acb33c42c5ebd7fa85d421ffa","original_commit_id":"6841c8e7e9602f8acb33c42c5ebd7fa85d421ffa","user":{"login":"patci","id":12869788,"avatar_url":"https://avatars.githubusercontent.com/u/12869788?v=3","gravatar_id":"","url":"https://api.github.com/users/patci","html_url":"https://github.com/patci","followers_url":"https://api.github.com/users/patci/followers","following_url":"https://api.github.com/users/patci/following{/other_user}","gists_url":"https://api.github.com/users/patci/gists{/gist_id}","starred_url":"https://api.github.com/users/patci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patci/subscriptions","organizations_url":"https://api.github.com/users/patci/orgs","repos_url":"https://api.github.com/users/patci/repos","events_url":"https://api.github.com/users/patci/events{/privacy}","received_events_url":"https://api.github.com/users/patci/received_events","type":"User","site_admin":false},"body":"I really like this approach, nice job! 👍 ","created_at":"2016-05-19T22:41:57Z","updated_at":"2016-05-19T22:41:57Z","html_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3#discussion_r63966025","pull_request_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/comments/63966025"},"html":{"href":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3#discussion_r63966025"},"pull_request":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3","id":70745627,"html_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3","diff_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3.diff","patch_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3.patch","issue_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/3","number":3,"state":"open","locked":false,"title":"added rockin' expect test","user":{"login":"derekgraham","id":17793690,"avatar_url":"https://avatars.githubusercontent.com/u/17793690?v=3","gravatar_id":"","url":"https://api.github.com/users/derekgraham","html_url":"https://github.com/derekgraham","followers_url":"https://api.github.com/users/derekgraham/followers","following_url":"https://api.github.com/users/derekgraham/following{/other_user}","gists_url":"https://api.github.com/users/derekgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/derekgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekgraham/subscriptions","organizations_url":"https://api.github.com/users/derekgraham/orgs","repos_url":"https://api.github.com/users/derekgraham/repos","events_url":"https://api.github.com/users/derekgraham/events{/privacy}","received_events_url":"https://api.github.com/users/derekgraham/received_events","type":"User","site_admin":false},"body":"Today I worked with myself. It took about 10 minutes.\r\n\r\n#### Reflect and summarize on your process:\r\nFirst I created generated a random number to use as an array index of the favorite animals and assigned an random animal to the variable. Then I wrote an expression to confirm that the assigned value of the variable was actually in the array. Then I wrote some very will formatted sucess and failure messages for the expect function. \r\n\r\nThen I ran the test from the console using node to confirm the the results of my test. It passed.\r\n\r\n- [ X] I have entered the Pull Request title in the format of \"MyName-PartnerName\"\r\n\r\n","created_at":"2016-05-19T18:50:56Z","updated_at":"2016-05-19T22:41:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31f21944843089a120ff2122112157331e6803db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3/commits","review_comments_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3/comments","review_comment_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/3/comments","statuses_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/statuses/6841c8e7e9602f8acb33c42c5ebd7fa85d421ffa","head":{"label":"derekgraham:derek","ref":"derek","sha":"6841c8e7e9602f8acb33c42c5ebd7fa85d421ffa","user":{"login":"derekgraham","id":17793690,"avatar_url":"https://avatars.githubusercontent.com/u/17793690?v=3","gravatar_id":"","url":"https://api.github.com/users/derekgraham","html_url":"https://github.com/derekgraham","followers_url":"https://api.github.com/users/derekgraham/followers","following_url":"https://api.github.com/users/derekgraham/following{/other_user}","gists_url":"https://api.github.com/users/derekgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/derekgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekgraham/subscriptions","organizations_url":"https://api.github.com/users/derekgraham/orgs","repos_url":"https://api.github.com/users/derekgraham/repos","events_url":"https://api.github.com/users/derekgraham/events{/privacy}","received_events_url":"https://api.github.com/users/derekgraham/received_events","type":"User","site_admin":false},"repo":{"id":59230610,"name":"09-testing-part-one","full_name":"derekgraham/09-testing-part-one","owner":{"login":"derekgraham","id":17793690,"avatar_url":"https://avatars.githubusercontent.com/u/17793690?v=3","gravatar_id":"","url":"https://api.github.com/users/derekgraham","html_url":"https://github.com/derekgraham","followers_url":"https://api.github.com/users/derekgraham/followers","following_url":"https://api.github.com/users/derekgraham/following{/other_user}","gists_url":"https://api.github.com/users/derekgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/derekgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekgraham/subscriptions","organizations_url":"https://api.github.com/users/derekgraham/orgs","repos_url":"https://api.github.com/users/derekgraham/repos","events_url":"https://api.github.com/users/derekgraham/events{/privacy}","received_events_url":"https://api.github.com/users/derekgraham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/derekgraham/09-testing-part-one","description":"Writing tests and solving problems!","fork":true,"url":"https://api.github.com/repos/derekgraham/09-testing-part-one","forks_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/forks","keys_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/keys{/key_id}","collaborators_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/teams","hooks_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/hooks","issue_events_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/issues/events{/number}","events_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/events","assignees_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/assignees{/user}","branches_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/branches{/branch}","tags_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/tags","blobs_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/git/refs{/sha}","trees_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/git/trees{/sha}","statuses_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/statuses/{sha}","languages_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/languages","stargazers_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/stargazers","contributors_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/contributors","subscribers_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/subscribers","subscription_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/subscription","commits_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/commits{/sha}","git_commits_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/git/commits{/sha}","comments_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/comments{/number}","issue_comment_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/issues/comments{/number}","contents_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/contents/{+path}","compare_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/compare/{base}...{head}","merges_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/merges","archive_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/downloads","issues_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/issues{/number}","pulls_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/pulls{/number}","milestones_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/milestones{/number}","notifications_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/labels{/name}","releases_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/releases{/id}","deployments_url":"https://api.github.com/repos/derekgraham/09-testing-part-one/deployments","created_at":"2016-05-19T18:11:44Z","updated_at":"2016-05-19T18:11:44Z","pushed_at":"2016-05-19T18:48:24Z","git_url":"git://github.com/derekgraham/09-testing-part-one.git","ssh_url":"git@github.com:derekgraham/09-testing-part-one.git","clone_url":"https://github.com/derekgraham/09-testing-part-one.git","svn_url":"https://github.com/derekgraham/09-testing-part-one","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codefellows-seattle-301d4:master","ref":"master","sha":"55317fc6881038b0cb244c7a79f25f52562b97e4","user":{"login":"codefellows-seattle-301d4","id":18607604,"avatar_url":"https://avatars.githubusercontent.com/u/18607604?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-301d4","html_url":"https://github.com/codefellows-seattle-301d4","followers_url":"https://api.github.com/users/codefellows-seattle-301d4/followers","following_url":"https://api.github.com/users/codefellows-seattle-301d4/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-301d4/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-301d4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-301d4/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-301d4/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-301d4/repos","events_url":"https://api.github.com/users/codefellows-seattle-301d4/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-301d4/received_events","type":"Organization","site_admin":false},"repo":{"id":58022189,"name":"09-testing-part-one","full_name":"codefellows-seattle-301d4/09-testing-part-one","owner":{"login":"codefellows-seattle-301d4","id":18607604,"avatar_url":"https://avatars.githubusercontent.com/u/18607604?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-301d4","html_url":"https://github.com/codefellows-seattle-301d4","followers_url":"https://api.github.com/users/codefellows-seattle-301d4/followers","following_url":"https://api.github.com/users/codefellows-seattle-301d4/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-301d4/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-301d4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-301d4/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-301d4/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-301d4/repos","events_url":"https://api.github.com/users/codefellows-seattle-301d4/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-301d4/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one","description":"Writing tests and solving problems!","fork":false,"url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one","forks_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/forks","keys_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/teams","hooks_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/hooks","issue_events_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/events","assignees_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/tags","blobs_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/languages","stargazers_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/stargazers","contributors_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/contributors","subscribers_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/subscribers","subscription_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/subscription","commits_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/merges","archive_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/downloads","issues_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/releases{/id}","deployments_url":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/deployments","created_at":"2016-05-04T04:14:43Z","updated_at":"2016-05-05T04:45:23Z","pushed_at":"2016-05-19T21:04:48Z","git_url":"git://github.com/codefellows-seattle-301d4/09-testing-part-one.git","ssh_url":"git@github.com:codefellows-seattle-301d4/09-testing-part-one.git","clone_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one.git","svn_url":"https://github.com/codefellows-seattle-301d4/09-testing-part-one","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":9,"forks":19,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3"},"html":{"href":"https://github.com/codefellows-seattle-301d4/09-testing-part-one/pull/3"},"issue":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/3"},"comments":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-seattle-301d4/09-testing-part-one/statuses/6841c8e7e9602f8acb33c42c5ebd7fa85d421ffa"}}}}
{"actor":{"display_login":"patci"}}