{"action":"created","comment":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/40213583","id":40213583,"diff_hunk":"@@ -0,0 +1,262 @@\n+'use strict';\n+\n+var chai = require( 'chai' );\n+var sinon = require( 'sinon' );\n+var expect = chai.expect;\n+var jsdom = require( 'mocha-jsdom' );\n+\n+describe( 'web-storage-proxy', function() {\n+  var webStorageProxy, sandbox, setItem, getItem, removeItem, setStorage;\n+\n+  jsdom();\n+\n+  before( function() {\n+    webStorageProxy =\n+      require( '../../../../src/static/js/modules/util/web-storage-proxy.js' );","path":"test/unit_tests/modules/util/web-storage-proxy.js","position":15,"original_position":15,"commit_id":"3631833d989400c4cc8fc80f7055e67babe34988","original_commit_id":"3631833d989400c4cc8fc80f7055e67babe34988","user":{"login":"anselmbradford","id":704760,"avatar_url":"https://avatars.githubusercontent.com/u/704760?v=3","gravatar_id":"","url":"https://api.github.com/users/anselmbradford","html_url":"https://github.com/anselmbradford","followers_url":"https://api.github.com/users/anselmbradford/followers","following_url":"https://api.github.com/users/anselmbradford/following{/other_user}","gists_url":"https://api.github.com/users/anselmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/anselmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anselmbradford/subscriptions","organizations_url":"https://api.github.com/users/anselmbradford/orgs","repos_url":"https://api.github.com/users/anselmbradford/repos","events_url":"https://api.github.com/users/anselmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/anselmbradford/received_events","type":"User","site_admin":false},"body":"Move require to top of file. There's no need to require a module before every test, right? If there's state that needs to be cleared, clear that out in the before. Though if that's necessary it may indicate the module should be a class or have an init function.","created_at":"2015-09-23T14:59:21Z","updated_at":"2015-09-23T14:59:21Z","html_url":"https://github.com/cfpb/cfgov-refresh/pull/1007#discussion_r40213583","pull_request_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007","_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/40213583"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/1007#discussion_r40213583"},"pull_request":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007"}}},"pull_request":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007","id":45708005,"html_url":"https://github.com/cfpb/cfgov-refresh/pull/1007","diff_url":"https://github.com/cfpb/cfgov-refresh/pull/1007.diff","patch_url":"https://github.com/cfpb/cfgov-refresh/pull/1007.patch","issue_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/1007","number":1007,"state":"open","locked":false,"title":"Added testing for web-storage-proxy.js","user":{"login":"jimmynotjim","id":1280430,"avatar_url":"https://avatars.githubusercontent.com/u/1280430?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmynotjim","html_url":"https://github.com/jimmynotjim","followers_url":"https://api.github.com/users/jimmynotjim/followers","following_url":"https://api.github.com/users/jimmynotjim/following{/other_user}","gists_url":"https://api.github.com/users/jimmynotjim/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmynotjim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmynotjim/subscriptions","organizations_url":"https://api.github.com/users/jimmynotjim/orgs","repos_url":"https://api.github.com/users/jimmynotjim/repos","events_url":"https://api.github.com/users/jimmynotjim/events{/privacy}","received_events_url":"https://api.github.com/users/jimmynotjim/received_events","type":"User","site_admin":false},"body":"Added testing for web-storage-proxy.js\r\n\r\n## Additions\r\n\r\n- Added tests to increase coverage to 100% across the board\r\n\r\n## Changes\r\n\r\n- Refactored code to be less complex and allow for easier testing\r\n- Updated code to utilize storage object instead of boolean to allow for storage options outside the window object\r\n\r\n## Testing\r\n\r\n- Run `gulp test:unit:scripts` see the green across the board for this file\r\n\r\n## Review\r\n\r\n- @KimberlyMunoz \r\n- @anselmbradford \r\n- @sebworks \r\n\r\n## Screenshots\r\n\r\n__Before__\r\n=============================== Coverage summary ===============================\r\nStatements   : 26.51% ( 321/1211 )\r\nBranches     : 21.84% ( 90/412 )\r\nFunctions    : 22.49% ( 56/249 )\r\nLines        : 26.75% ( 321/1200 )\r\n\r\n\r\n__After__\r\n=============================== Coverage summary ===============================\r\n\r\nStatements   : 28.37% ( 343/1209 )\r\nBranches     : 24.27% ( 100/412 )\r\nFunctions    : 24.5% ( 61/249 )\r\nLines        : 28.54% ( 343/1202 )\r\n\r\n\r\n## Notes\r\n\r\n- Skipping tests of internal private functions\r\n\r\n## Checklist\r\n\r\n* [ ] Changes are limited to a single goal (no scope creep)\r\n* [ ] Code can be automatically merged (no conflicts)\r\n* [ ] Code follows the standards laid out in the [front end playbook](https://github.com/cfpb/front-end)\r\n* [ ] Passes all existing automated tests\r\n* [ ] New functions include new tests\r\n* [ ] New functions are documented (with a description, list of inputs, and expected output)\r\n* [ ] Placeholder code is flagged\r\n* [ ] Visually tested in supported browsers and devices \r\n* [ ] Project documentation has been updated (including the \"Unreleased\" section of the CHANGELOG)","created_at":"2015-09-22T19:47:54Z","updated_at":"2015-09-23T14:59:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60916c540eda914dac2c851ef6fa549bc9361213","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007/commits","review_comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007/comments","review_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/1007/comments","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/3631833d989400c4cc8fc80f7055e67babe34988","head":{"label":"cfpb:web-storage-proxy-test","ref":"web-storage-proxy-test","sha":"3631833d989400c4cc8fc80f7055e67babe34988","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":18852566,"name":"cfgov-refresh","full_name":"cfpb/cfgov-refresh","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/cfgov-refresh","description":"In-progress redesign of the consumerfinance.gov website.","fork":false,"url":"https://api.github.com/repos/cfpb/cfgov-refresh","forks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfpb/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfpb/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/cfgov-refresh/releases{/id}","created_at":"2014-04-16T19:22:03Z","updated_at":"2015-07-16T17:30:22Z","pushed_at":"2015-09-23T14:47:33Z","git_url":"git://github.com/cfpb/cfgov-refresh.git","ssh_url":"git@github.com:cfpb/cfgov-refresh.git","clone_url":"https://github.com/cfpb/cfgov-refresh.git","svn_url":"https://github.com/cfpb/cfgov-refresh","homepage":"","size":101299,"stargazers_count":9,"watchers_count":9,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":104,"forks":18,"open_issues":104,"watchers":9,"default_branch":"flapjack"}},"base":{"label":"cfpb:flapjack","ref":"flapjack","sha":"0ffe183cc9d908af55fa081cb29de8e93cdd502d","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":18852566,"name":"cfgov-refresh","full_name":"cfpb/cfgov-refresh","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/cfgov-refresh","description":"In-progress redesign of the consumerfinance.gov website.","fork":false,"url":"https://api.github.com/repos/cfpb/cfgov-refresh","forks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfpb/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfpb/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/cfgov-refresh/releases{/id}","created_at":"2014-04-16T19:22:03Z","updated_at":"2015-07-16T17:30:22Z","pushed_at":"2015-09-23T14:47:33Z","git_url":"git://github.com/cfpb/cfgov-refresh.git","ssh_url":"git@github.com:cfpb/cfgov-refresh.git","clone_url":"https://github.com/cfpb/cfgov-refresh.git","svn_url":"https://github.com/cfpb/cfgov-refresh","homepage":"","size":101299,"stargazers_count":9,"watchers_count":9,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":104,"forks":18,"open_issues":104,"watchers":9,"default_branch":"flapjack"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/1007"},"issue":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/1007"},"comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/1007/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/1007/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/3631833d989400c4cc8fc80f7055e67babe34988"}}}}