Chapter 8: add first recipe samples
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
module.exports = {
|
||||
login: "octokit",
|
||||
id: 3430433,
|
||||
node_id: "MDEyOk9yZ2FuaXphdGlvbjM0MzA0MzM=",
|
||||
avatar_url: "https://avatars0.githubusercontent.com/u/3430433?v=4",
|
||||
gravatar_id: "",
|
||||
url: "https://api.github.com/users/octokit",
|
||||
html_url: "https://github.com/octokit",
|
||||
followers_url: "https://api.github.com/users/octokit/followers",
|
||||
following_url: "https://api.github.com/users/octokit/following{/other_user}",
|
||||
gists_url: "https://api.github.com/users/octokit/gists{/gist_id}",
|
||||
starred_url: "https://api.github.com/users/octokit/starred{/owner}{/repo}",
|
||||
subscriptions_url: "https://api.github.com/users/octokit/subscriptions",
|
||||
organizations_url: "https://api.github.com/users/octokit/orgs",
|
||||
repos_url: "https://api.github.com/users/octokit/repos",
|
||||
events_url: "https://api.github.com/users/octokit/events{/privacy}",
|
||||
received_events_url: "https://api.github.com/users/octokit/received_events",
|
||||
type: "Organization",
|
||||
site_admin: false,
|
||||
name: "Octokit",
|
||||
company: null,
|
||||
blog: "http://octokit.github.io",
|
||||
location: null,
|
||||
email: null,
|
||||
hireable: null,
|
||||
bio: "Official clients for the GitHub API",
|
||||
twitter_username: "octokit",
|
||||
public_repos: 44,
|
||||
public_gists: 0,
|
||||
followers: 0,
|
||||
following: 0,
|
||||
created_at: "2013-01-30T18:13:42Z",
|
||||
updated_at: "2020-06-09T20:53:23Z",
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
const test = require("tape");
|
||||
const sinon = require("sinon");
|
||||
|
||||
const github = require("../github.js");
|
||||
const octokitUserData = require("./octokitUserData.js");
|
||||
|
||||
test("Get GitHub user by username", async function (t) {
|
||||
t.plan(3);
|
||||
|
||||
sinon.stub(github, "getGitHubUser").returns(octokitUserData);
|
||||
|
||||
const githubUser = await github.getGitHubUser("Octokit");
|
||||
|
||||
t.equal(githubUser.id, 3430433);
|
||||
t.equal(githubUser.login, "octokit");
|
||||
t.equal(githubUser.name, "Octokit");
|
||||
});
|
||||
Reference in New Issue
Block a user