{"action":"created","comment":{"url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/comments/47708635","id":47708635,"diff_hunk":"@@ -1,2 +1,104 @@\n-# styleguide\n-contains runnable coding guidelines to maintain consistency across all our repos  \n+# Runnable Code and Test Patterns Guide\n+\n+Runnable's approach to writing code and tests.\n+\n+## Table of Contents\n+\n+1. [Code Formatting](#code-formatting)\n+1. [Testing](#testing)\n+    1. [Types of Tests](#types-of-tests)\n+    1. [Stubbing](#stubbing)\n+    1. [Asserting](#asserting)\n+    1. [Additional Testing Reading](#additional-testing-reading)\n+\n+## Code Formatting\n+\n+[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n+\n+We use [`standard`](http://standardjs.com/) in most projects. If it passes `standard`, anything else is up to the developer. No questions asked.\n+\n+**[back to the top](#table-of-contents)**\n+\n+## Testing\n+\n+Let's discuss various tests, what they should do and cover, and how best to organize them.\n+\n+### Types of Tests\n+\n+There are three types of tests we should be concerned about.\n+\n+- Unit\n+- Integration\n+- Functional\n+\n+#### Definitions\n+\n+**Unit** tests are pretty obvious (or should be). They test exactly one unit of functionality. Most likely this should follow the boundaries of functions or at largest, modules. If we're finding we're writing a lot unit tests for a specific function, it may need to be broken up.\n+\n+An important note: unit tests should _never_ touch an external service (e.g. database).","path":"README.md","position":40,"original_position":40,"commit_id":"222d21132f1b616552b4990c5374df40c299ac33","original_commit_id":"222d21132f1b616552b4990c5374df40c299ac33","user":{"login":"thejsj","id":1981198,"avatar_url":"https://avatars.githubusercontent.com/u/1981198?v=3","gravatar_id":"","url":"https://api.github.com/users/thejsj","html_url":"https://github.com/thejsj","followers_url":"https://api.github.com/users/thejsj/followers","following_url":"https://api.github.com/users/thejsj/following{/other_user}","gists_url":"https://api.github.com/users/thejsj/gists{/gist_id}","starred_url":"https://api.github.com/users/thejsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejsj/subscriptions","organizations_url":"https://api.github.com/users/thejsj/orgs","repos_url":"https://api.github.com/users/thejsj/repos","events_url":"https://api.github.com/users/thejsj/events{/privacy}","received_events_url":"https://api.github.com/users/thejsj/received_events","type":"User","site_admin":false},"body":"Simple example: https://github.com/CodeNow/api/blob/master/unit/models/mongo/user.js","created_at":"2015-12-15T22:24:22Z","updated_at":"2015-12-15T22:24:22Z","html_url":"https://github.com/CodeNow/code-styleguide/pull/3#discussion_r47708635","pull_request_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/comments/47708635"},"html":{"href":"https://github.com/CodeNow/code-styleguide/pull/3#discussion_r47708635"},"pull_request":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3","id":53655684,"html_url":"https://github.com/CodeNow/code-styleguide/pull/3","diff_url":"https://github.com/CodeNow/code-styleguide/pull/3.diff","patch_url":"https://github.com/CodeNow/code-styleguide/pull/3.patch","issue_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/3","number":3,"state":"open","locked":false,"title":"Code Formatting and Testing","user":{"login":"bkendall","id":160236,"avatar_url":"https://avatars.githubusercontent.com/u/160236?v=3","gravatar_id":"","url":"https://api.github.com/users/bkendall","html_url":"https://github.com/bkendall","followers_url":"https://api.github.com/users/bkendall/followers","following_url":"https://api.github.com/users/bkendall/following{/other_user}","gists_url":"https://api.github.com/users/bkendall/gists{/gist_id}","starred_url":"https://api.github.com/users/bkendall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkendall/subscriptions","organizations_url":"https://api.github.com/users/bkendall/orgs","repos_url":"https://api.github.com/users/bkendall/repos","events_url":"https://api.github.com/users/bkendall/events{/privacy}","received_events_url":"https://api.github.com/users/bkendall/received_events","type":"User","site_admin":false},"body":"I attempted to bring in all the thoughts on #1 and #2. Let's finish these off and get them into something official looking!","created_at":"2015-12-15T03:25:36Z","updated_at":"2015-12-15T22:24:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7b15fdc7c4fb0e3daa26d59b780f574e2814b5e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3/commits","review_comments_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3/comments","review_comment_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/3/comments","statuses_url":"https://api.github.com/repos/CodeNow/code-styleguide/statuses/222d21132f1b616552b4990c5374df40c299ac33","head":{"label":"CodeNow:format-testing","ref":"format-testing","sha":"222d21132f1b616552b4990c5374df40c299ac33","user":{"login":"CodeNow","id":2335750,"avatar_url":"https://avatars.githubusercontent.com/u/2335750?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeNow","html_url":"https://github.com/CodeNow","followers_url":"https://api.github.com/users/CodeNow/followers","following_url":"https://api.github.com/users/CodeNow/following{/other_user}","gists_url":"https://api.github.com/users/CodeNow/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeNow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeNow/subscriptions","organizations_url":"https://api.github.com/users/CodeNow/orgs","repos_url":"https://api.github.com/users/CodeNow/repos","events_url":"https://api.github.com/users/CodeNow/events{/privacy}","received_events_url":"https://api.github.com/users/CodeNow/received_events","type":"Organization","site_admin":false},"repo":{"id":47165076,"name":"code-styleguide","full_name":"CodeNow/code-styleguide","owner":{"login":"CodeNow","id":2335750,"avatar_url":"https://avatars.githubusercontent.com/u/2335750?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeNow","html_url":"https://github.com/CodeNow","followers_url":"https://api.github.com/users/CodeNow/followers","following_url":"https://api.github.com/users/CodeNow/following{/other_user}","gists_url":"https://api.github.com/users/CodeNow/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeNow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeNow/subscriptions","organizations_url":"https://api.github.com/users/CodeNow/orgs","repos_url":"https://api.github.com/users/CodeNow/repos","events_url":"https://api.github.com/users/CodeNow/events{/privacy}","received_events_url":"https://api.github.com/users/CodeNow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CodeNow/code-styleguide","description":"contains runnable coding guidelines to maintain consistency across all our repos  ","fork":false,"url":"https://api.github.com/repos/CodeNow/code-styleguide","forks_url":"https://api.github.com/repos/CodeNow/code-styleguide/forks","keys_url":"https://api.github.com/repos/CodeNow/code-styleguide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeNow/code-styleguide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeNow/code-styleguide/teams","hooks_url":"https://api.github.com/repos/CodeNow/code-styleguide/hooks","issue_events_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/events{/number}","events_url":"https://api.github.com/repos/CodeNow/code-styleguide/events","assignees_url":"https://api.github.com/repos/CodeNow/code-styleguide/assignees{/user}","branches_url":"https://api.github.com/repos/CodeNow/code-styleguide/branches{/branch}","tags_url":"https://api.github.com/repos/CodeNow/code-styleguide/tags","blobs_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeNow/code-styleguide/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeNow/code-styleguide/languages","stargazers_url":"https://api.github.com/repos/CodeNow/code-styleguide/stargazers","contributors_url":"https://api.github.com/repos/CodeNow/code-styleguide/contributors","subscribers_url":"https://api.github.com/repos/CodeNow/code-styleguide/subscribers","subscription_url":"https://api.github.com/repos/CodeNow/code-styleguide/subscription","commits_url":"https://api.github.com/repos/CodeNow/code-styleguide/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeNow/code-styleguide/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeNow/code-styleguide/contents/{+path}","compare_url":"https://api.github.com/repos/CodeNow/code-styleguide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeNow/code-styleguide/merges","archive_url":"https://api.github.com/repos/CodeNow/code-styleguide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeNow/code-styleguide/downloads","issues_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues{/number}","pulls_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeNow/code-styleguide/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeNow/code-styleguide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeNow/code-styleguide/labels{/name}","releases_url":"https://api.github.com/repos/CodeNow/code-styleguide/releases{/id}","created_at":"2015-12-01T04:17:03Z","updated_at":"2015-12-15T00:10:37Z","pushed_at":"2015-12-15T21:49:18Z","git_url":"git://github.com/CodeNow/code-styleguide.git","ssh_url":"git@github.com:CodeNow/code-styleguide.git","clone_url":"https://github.com/CodeNow/code-styleguide.git","svn_url":"https://github.com/CodeNow/code-styleguide","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":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":"master"}},"base":{"label":"CodeNow:master","ref":"master","sha":"348487a71e52b673682b44046f5c635246264007","user":{"login":"CodeNow","id":2335750,"avatar_url":"https://avatars.githubusercontent.com/u/2335750?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeNow","html_url":"https://github.com/CodeNow","followers_url":"https://api.github.com/users/CodeNow/followers","following_url":"https://api.github.com/users/CodeNow/following{/other_user}","gists_url":"https://api.github.com/users/CodeNow/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeNow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeNow/subscriptions","organizations_url":"https://api.github.com/users/CodeNow/orgs","repos_url":"https://api.github.com/users/CodeNow/repos","events_url":"https://api.github.com/users/CodeNow/events{/privacy}","received_events_url":"https://api.github.com/users/CodeNow/received_events","type":"Organization","site_admin":false},"repo":{"id":47165076,"name":"code-styleguide","full_name":"CodeNow/code-styleguide","owner":{"login":"CodeNow","id":2335750,"avatar_url":"https://avatars.githubusercontent.com/u/2335750?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeNow","html_url":"https://github.com/CodeNow","followers_url":"https://api.github.com/users/CodeNow/followers","following_url":"https://api.github.com/users/CodeNow/following{/other_user}","gists_url":"https://api.github.com/users/CodeNow/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeNow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeNow/subscriptions","organizations_url":"https://api.github.com/users/CodeNow/orgs","repos_url":"https://api.github.com/users/CodeNow/repos","events_url":"https://api.github.com/users/CodeNow/events{/privacy}","received_events_url":"https://api.github.com/users/CodeNow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CodeNow/code-styleguide","description":"contains runnable coding guidelines to maintain consistency across all our repos  ","fork":false,"url":"https://api.github.com/repos/CodeNow/code-styleguide","forks_url":"https://api.github.com/repos/CodeNow/code-styleguide/forks","keys_url":"https://api.github.com/repos/CodeNow/code-styleguide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeNow/code-styleguide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeNow/code-styleguide/teams","hooks_url":"https://api.github.com/repos/CodeNow/code-styleguide/hooks","issue_events_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/events{/number}","events_url":"https://api.github.com/repos/CodeNow/code-styleguide/events","assignees_url":"https://api.github.com/repos/CodeNow/code-styleguide/assignees{/user}","branches_url":"https://api.github.com/repos/CodeNow/code-styleguide/branches{/branch}","tags_url":"https://api.github.com/repos/CodeNow/code-styleguide/tags","blobs_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeNow/code-styleguide/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeNow/code-styleguide/languages","stargazers_url":"https://api.github.com/repos/CodeNow/code-styleguide/stargazers","contributors_url":"https://api.github.com/repos/CodeNow/code-styleguide/contributors","subscribers_url":"https://api.github.com/repos/CodeNow/code-styleguide/subscribers","subscription_url":"https://api.github.com/repos/CodeNow/code-styleguide/subscription","commits_url":"https://api.github.com/repos/CodeNow/code-styleguide/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeNow/code-styleguide/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeNow/code-styleguide/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeNow/code-styleguide/contents/{+path}","compare_url":"https://api.github.com/repos/CodeNow/code-styleguide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeNow/code-styleguide/merges","archive_url":"https://api.github.com/repos/CodeNow/code-styleguide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeNow/code-styleguide/downloads","issues_url":"https://api.github.com/repos/CodeNow/code-styleguide/issues{/number}","pulls_url":"https://api.github.com/repos/CodeNow/code-styleguide/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeNow/code-styleguide/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeNow/code-styleguide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeNow/code-styleguide/labels{/name}","releases_url":"https://api.github.com/repos/CodeNow/code-styleguide/releases{/id}","created_at":"2015-12-01T04:17:03Z","updated_at":"2015-12-15T00:10:37Z","pushed_at":"2015-12-15T21:49:18Z","git_url":"git://github.com/CodeNow/code-styleguide.git","ssh_url":"git@github.com:CodeNow/code-styleguide.git","clone_url":"https://github.com/CodeNow/code-styleguide.git","svn_url":"https://github.com/CodeNow/code-styleguide","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":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":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3"},"html":{"href":"https://github.com/CodeNow/code-styleguide/pull/3"},"issue":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/issues/3"},"comments":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/CodeNow/code-styleguide/statuses/222d21132f1b616552b4990c5374df40c299ac33"}}}}