{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/64895218","id":64895218,"diff_hunk":"@@ -0,0 +1,118 @@\n+/**\n+ * External dependencies\n+ */\n+import { expect } from 'chai';\n+import request from 'superagent';\n+import supertest from 'supertest';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import { allowNetworkAccess } from 'test/helpers/nock-control';\n+import { useSandbox } from 'test/helpers/use-sinon';\n+\n+describe( 'api', function() {\n+\tlet app, config, localRequest, sandbox;\n+\n+\tallowNetworkAccess();\n+\tuseSandbox( newSandbox => sandbox = newSandbox );\n+\n+\tbefore( () => {\n+\t\tconfig = require( 'config' );\n+\t\tsandbox.stub( config, 'isEnabled' ).returns( true );\n+\t\tapp = require( '../' )();\n+\t\tlocalRequest = supertest( app );\n+\t} );\n+\n+\tafterEach( function() {\n+\t\tsandbox.restore();\n+\t} );\n+\n+\tit( 'should return package version', function( done ) {\n+\t\tconst version = require( '../../../package.json' ).version;\n+\n+\t\tlocalRequest.get( '/version' )\n+\t\t\t.expect( 200, { version: version }, done );\n+\t} );\n+\n+\tit( 'should clear oauth cookie and redirect to login_url', function( done ) {\n+\t\tlocalRequest\n+\t\t\t.get( '/logout' )\n+\t\t\t.redirects( 0 )\n+\t\t\t.set( 'cookie', 'wpcom_token=test' )\n+\t\t\t.expect( 'location', config( 'login_url' ) )\n+\t\t\t.expect( 'set-cookie', 'wpcom_token=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT' )\n+\t\t\t.expect( 302, done );\n+\t} );\n+\n+\t// this group works only with desktop oauth setup\n+\tif ( process.env.NODE_ENV === 'desktop' ) {","path":"server/api/test/index.js","position":49,"original_position":49,"commit_id":"ba7d24d4ec9da6fef28d4a62252ef07c4c356d08","original_commit_id":"ba7d24d4ec9da6fef28d4a62252ef07c4c356d08","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"body":"An option to consider, in at least showing the tests as skipped:\r\n\r\n```\r\nlet maybeIt = it;\r\nif ( process.env.NODE_ENV !== 'desktop' ) {\r\n\tmaybeIt = maybeIt.skip;\r\n}\r\n\r\nmaybeIt( 'should handle incomplete login details', // ...\r\n```","created_at":"2016-05-27T12:07:16Z","updated_at":"2016-05-27T12:07:16Z","html_url":"https://github.com/Automattic/wp-calypso/pull/4697#discussion_r64895218","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/64895218"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/4697#discussion_r64895218"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697","id":66279949,"html_url":"https://github.com/Automattic/wp-calypso/pull/4697","diff_url":"https://github.com/Automattic/wp-calypso/pull/4697.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/4697.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4697","number":4697,"state":"open","locked":false,"title":"Test: Refactor server/api test to allow part of the tests run in test env","user":{"login":"gziolo","id":699132,"avatar_url":"https://avatars.githubusercontent.com/u/699132?v=3","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"body":"Part of #4915.\r\n\r\nThis refactoring allows to run at least 2 of the tests in `server/api` test suite in test environment. All other tests require desktop specific oauth secret config values, so we should never expose them to the public. In the long run we should move all that related tests to desktop repository, unless we decide expose that functionality also for Calypso.\r\n\r\n/cc @aduth @blowery @mkaz @mjangda ","created_at":"2016-04-13T08:00:15Z","updated_at":"2016-05-27T12:07:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cce29bddec292b97ba7135917cbad1a25ad827b","assignee":{"login":"gziolo","id":699132,"avatar_url":"https://avatars.githubusercontent.com/u/699132?v=3","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/64","html_url":"https://github.com/Automattic/wp-calypso/milestones/Framework:%20Single%20test%20runner","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/64/labels","id":1632454,"number":64,"title":"Framework: Single test runner","description":"","creator":{"login":"gziolo","id":699132,"avatar_url":"https://avatars.githubusercontent.com/u/699132?v=3","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":82,"state":"open","created_at":"2016-03-09T09:01:14Z","updated_at":"2016-04-26T07:25:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4697/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/ba7d24d4ec9da6fef28d4a62252ef07c4c356d08","head":{"label":"Automattic:test/server-api","ref":"test/server-api","sha":"ba7d24d4ec9da6fef28d4a62252ef07c4c356d08","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-05-27T10:03:41Z","pushed_at":"2016-05-27T11:48:08Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":77144,"stargazers_count":7335,"watchers_count":7335,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":890,"mirror_url":null,"open_issues_count":1278,"forks":890,"open_issues":1278,"watchers":7335,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"bccfe5c45c1aaff1fddd91710c112ddc8edcca8d","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-05-27T10:03:41Z","pushed_at":"2016-05-27T11:48:08Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":77144,"stargazers_count":7335,"watchers_count":7335,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":890,"mirror_url":null,"open_issues_count":1278,"forks":890,"open_issues":1278,"watchers":7335,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/4697"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/4697"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/4697/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4697/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/ba7d24d4ec9da6fef28d4a62252ef07c4c356d08"}}}}
{"actor":{"display_login":"aduth"}}