-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
207 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[ | ||
{ | ||
"scope": "https://api.github.com:443", | ||
"method": "get", | ||
"path": "/orgs/octokit-fixture-org", | ||
"body": "", | ||
"status": 200, | ||
"response": { | ||
"login": "octokit-fixture-org", | ||
"id": 31898100, | ||
"url": "https://api.github.com/orgs/octokit-fixture-org", | ||
"repos_url": "https://api.github.com/orgs/octokit-fixture-org/repos", | ||
"events_url": "https://api.github.com/orgs/octokit-fixture-org/events", | ||
"hooks_url": "https://api.github.com/orgs/octokit-fixture-org/hooks", | ||
"issues_url": "https://api.github.com/orgs/octokit-fixture-org/issues", | ||
"members_url": "https://api.github.com/orgs/octokit-fixture-org/members{/member}", | ||
"public_members_url": "https://api.github.com/orgs/octokit-fixture-org/public_members{/member}", | ||
"avatar_url": "https://avatars2.githubusercontent.com/u/31898100?v=4", | ||
"description": null, | ||
"has_organization_projects": true, | ||
"has_repository_projects": true, | ||
"public_repos": 42, | ||
"public_gists": 0, | ||
"followers": 0, | ||
"following": 0, | ||
"html_url": "https://github.com/octokit-fixture-org", | ||
"created_at": "2017-10-10T16:00:00Z", | ||
"updated_at": "2017-10-10T16:00:00Z", | ||
"type": "Organization" | ||
}, | ||
"reqheaders": { | ||
"accept": "application/vnd.github.v3+json", | ||
"host": "api.github.com" | ||
}, | ||
"headers": { | ||
"access-control-allow-origin": "*", | ||
"access-control-expose-headers": "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", | ||
"cache-control": "public, max-age=60, s-maxage=60", | ||
"connection": "close", | ||
"content-length": "914", | ||
"content-security-policy": "default-src 'none'", | ||
"content-type": "application/json; charset=utf-8", | ||
"date": "Tue, 10 Oct 2017 16:00:00 GMT", | ||
"etag": "\"00000000000000000000000000000000\"", | ||
"last-modified": "Tue, 10 Oct 2017 16:00:00 GMT", | ||
"status": "200 OK", | ||
"strict-transport-security": "max-age=31536000; includeSubdomains; preload", | ||
"x-content-type-options": "nosniff", | ||
"x-frame-options": "deny", | ||
"x-github-media-type": "github.v3; format=json", | ||
"x-github-request-id": "0000:00000:0000000:0000000:00000000", | ||
"x-ratelimit-limit": "60", | ||
"x-ratelimit-remaining": "59", | ||
"x-ratelimit-reset": "1507651200000", | ||
"x-runtime-rack": "0.000000", | ||
"x-xss-protection": "1; mode=block" | ||
}, | ||
"badheaders": [ | ||
"authorization" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,82 +2,82 @@ | |
{ | ||
"scope": "https://api.github.com:443", | ||
"method": "get", | ||
"path": "/repos/octocat/hello-world", | ||
"path": "/repos/octokit-fixture-org/hello-world", | ||
"body": "", | ||
"status": 200, | ||
"response": { | ||
"id": 1296269, | ||
"name": "Hello-World", | ||
"full_name": "octocat/Hello-World", | ||
"id": 103703892, | ||
"name": "hello-world", | ||
"full_name": "octokit-fixture-org/hello-world", | ||
"owner": { | ||
"login": "octocat", | ||
"id": 583231, | ||
"avatar_url": "https://avatars3.githubusercontent.com/u/583231?v=4", | ||
"login": "octokit-fixture-org", | ||
"id": 31898100, | ||
"avatar_url": "https://avatars2.githubusercontent.com/u/31898100?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/octocat", | ||
"html_url": "https://github.com/octocat", | ||
"followers_url": "https://api.github.com/users/octocat/followers", | ||
"following_url": "https://api.github.com/users/octocat/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", | ||
"organizations_url": "https://api.github.com/users/octocat/orgs", | ||
"repos_url": "https://api.github.com/users/octocat/repos", | ||
"events_url": "https://api.github.com/users/octocat/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/octocat/received_events", | ||
"type": "User", | ||
"url": "https://api.github.com/users/octokit-fixture-org", | ||
"html_url": "https://github.com/octokit-fixture-org", | ||
"followers_url": "https://api.github.com/users/octokit-fixture-org/followers", | ||
"following_url": "https://api.github.com/users/octokit-fixture-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/octokit-fixture-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/octokit-fixture-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/octokit-fixture-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/octokit-fixture-org/orgs", | ||
"repos_url": "https://api.github.com/users/octokit-fixture-org/repos", | ||
"events_url": "https://api.github.com/users/octokit-fixture-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/octokit-fixture-org/received_events", | ||
"type": "Organization", | ||
"site_admin": false | ||
}, | ||
"private": false, | ||
"html_url": "https://github.com/octocat/Hello-World", | ||
"description": "My first repository on GitHub!", | ||
"html_url": "https://github.com/octokit-fixture-org/hello-world", | ||
"description": null, | ||
"fork": false, | ||
"url": "https://api.github.com/repos/octocat/Hello-World", | ||
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", | ||
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", | ||
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", | ||
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", | ||
"hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", | ||
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", | ||
"events_url": "https://api.github.com/repos/octocat/Hello-World/events", | ||
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", | ||
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", | ||
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", | ||
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", | ||
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", | ||
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", | ||
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", | ||
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", | ||
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", | ||
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", | ||
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", | ||
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", | ||
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", | ||
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", | ||
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", | ||
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", | ||
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", | ||
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", | ||
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", | ||
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", | ||
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", | ||
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", | ||
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", | ||
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", | ||
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", | ||
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", | ||
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", | ||
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", | ||
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", | ||
"url": "https://api.github.com/repos/octokit-fixture-org/hello-world", | ||
"forks_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/forks", | ||
"keys_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/keys{/key_id}", | ||
"collaborators_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/collaborators{/collaborator}", | ||
"teams_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/teams", | ||
"hooks_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/hooks", | ||
"issue_events_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/issues/events{/number}", | ||
"events_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/events", | ||
"assignees_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/assignees{/user}", | ||
"branches_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/branches{/branch}", | ||
"tags_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/tags", | ||
"blobs_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/git/blobs{/sha}", | ||
"git_tags_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/git/tags{/sha}", | ||
"git_refs_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/git/refs{/sha}", | ||
"trees_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/git/trees{/sha}", | ||
"statuses_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/statuses/{sha}", | ||
"languages_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/languages", | ||
"stargazers_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/stargazers", | ||
"contributors_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/contributors", | ||
"subscribers_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/subscribers", | ||
"subscription_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/subscription", | ||
"commits_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/commits{/sha}", | ||
"git_commits_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/git/commits{/sha}", | ||
"comments_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/comments{/number}", | ||
"issue_comment_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/issues/comments{/number}", | ||
"contents_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/contents/{+path}", | ||
"compare_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/compare/{base}...{head}", | ||
"merges_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/merges", | ||
"archive_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/{archive_format}{/ref}", | ||
"downloads_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/downloads", | ||
"issues_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/issues{/number}", | ||
"pulls_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/pulls{/number}", | ||
"milestones_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/milestones{/number}", | ||
"notifications_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/notifications{?since,all,participating}", | ||
"labels_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/labels{/name}", | ||
"releases_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/releases{/id}", | ||
"deployments_url": "https://api.github.com/repos/octokit-fixture-org/hello-world/deployments", | ||
"created_at": "2017-10-10T16:00:00Z", | ||
"updated_at": "2017-10-10T16:00:00Z", | ||
"pushed_at": "2017-10-10T16:00:00Z", | ||
"git_url": "git://github.com/octocat/Hello-World.git", | ||
"ssh_url": "[email protected]:octocat/Hello-World.git", | ||
"clone_url": "https://github.com/octocat/Hello-World.git", | ||
"svn_url": "https://github.com/octocat/Hello-World", | ||
"homepage": "", | ||
"size": 578, | ||
"git_url": "git://github.com/octokit-fixture-org/hello-world.git", | ||
"ssh_url": "[email protected]:octokit-fixture-org/hello-world.git", | ||
"clone_url": "https://github.com/octokit-fixture-org/hello-world.git", | ||
"svn_url": "https://github.com/octokit-fixture-org/hello-world", | ||
"homepage": null, | ||
"size": 0, | ||
"stargazers_count": 42, | ||
"watchers_count": 42, | ||
"language": null, | ||
|
@@ -93,6 +93,25 @@ | |
"open_issues": 42, | ||
"watchers": 42, | ||
"default_branch": "master", | ||
"organization": { | ||
"login": "octokit-fixture-org", | ||
"id": 31898100, | ||
"avatar_url": "https://avatars2.githubusercontent.com/u/31898100?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/octokit-fixture-org", | ||
"html_url": "https://github.com/octokit-fixture-org", | ||
"followers_url": "https://api.github.com/users/octokit-fixture-org/followers", | ||
"following_url": "https://api.github.com/users/octokit-fixture-org/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/octokit-fixture-org/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/octokit-fixture-org/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/octokit-fixture-org/subscriptions", | ||
"organizations_url": "https://api.github.com/users/octokit-fixture-org/orgs", | ||
"repos_url": "https://api.github.com/users/octokit-fixture-org/repos", | ||
"events_url": "https://api.github.com/users/octokit-fixture-org/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/octokit-fixture-org/received_events", | ||
"type": "Organization", | ||
"site_admin": false | ||
}, | ||
"network_count": 42, | ||
"subscribers_count": 42 | ||
}, | ||
|
@@ -105,7 +124,7 @@ | |
"access-control-expose-headers": "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", | ||
"cache-control": "public, max-age=60, s-maxage=60", | ||
"connection": "close", | ||
"content-length": "4721", | ||
"content-length": "6398", | ||
"content-security-policy": "default-src 'none'", | ||
"content-type": "application/json; charset=utf-8", | ||
"date": "Tue, 10 Oct 2017 16:00:00 GMT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = normalizeOrganization | ||
|
||
const setIfExists = require('../set-if-exists') | ||
|
||
function normalizeOrganization (fixture) { | ||
// set all counts to 42 | ||
setIfExists(fixture.response, 'public_repos', 42) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = normalizeRepository | ||
|
||
const setIfExists = require('../set-if-exists') | ||
|
||
function normalizeRepository (fixture) { | ||
// set all dates to Universe 2017 Keynote time | ||
setIfExists(fixture.response, 'pushed_at', '2017-10-10T16:00:00Z') | ||
|
||
// set all counts to 42 | ||
setIfExists(fixture.response, 'forks_count', 42) | ||
setIfExists(fixture.response, 'forks', 42) | ||
setIfExists(fixture.response, 'network_count', 42) | ||
setIfExists(fixture.response, 'open_issues_count', 42) | ||
setIfExists(fixture.response, 'open_issues', 42) | ||
setIfExists(fixture.response, 'stargazers_count', 42) | ||
setIfExists(fixture.response, 'subscribers_count', 42) | ||
setIfExists(fixture.response, 'watchers_count', 42) | ||
setIfExists(fixture.response, 'watchers', 42) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = setIfExists | ||
|
||
function setIfExists (object, key, value) { | ||
if (key in object) { | ||
object[key] = value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = toEntityName | ||
|
||
function toEntityName (object) { | ||
if (object.type === 'Organization') { | ||
return 'organization' | ||
} | ||
if ('forks' in object) { | ||
return 'repository' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
method: 'get', | ||
url: '/orgs/octokit-fixture-org', | ||
headers: { | ||
Accept: 'application/vnd.github.v3+json' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters