Chapter 8: add first recipe samples
This commit is contained in:
@@ -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