React Props Octo Kit Gists

Elvenware Logo



Learn to use OctoKit:

I'm expecting to find your work in branches week08 and master. Work mostly in /micros/git-gist/routes/index.js.

Log into your account on GitHub and create a secret, hidden Gist with exactly these properties:

Add one comment exactly like this to it: This is my comment.

Now create a public gist exactly like this:

Add one comment exactly like this to it: This is my comment.

Get Started

Run some installs:

npm i @octokit/rest
npm i supertest

Sanity Tests

Make sure JsObjects is up to date.

Create a directory called micros/git-gist/sanity-tests. Navigate into it. Run get-tests. Select the menu item labeled:

This should place a file called Sanity.GetGists.test.js in your sanity-tests folder.

Get the tests to pass.

Add a test item to the scripts section of /micros/git-gist/package.json:

"test": "jest"


Import Octokit into your routes/index.js as per the docs.

In the constructor for Octokit, I managed to get signed in by providing these properties in an object literal:

The specific example I outline above is not in the docs, but you can read the docs here.

In my implementation of both routes found in the tests, I used the call labeled like this in the OctoKit docs on handling Gists: List the authenticated user's gists or if called anonymously, this will return all public gists. This was the second call described in the set of calls under Gists. Of course, we are not calling it anonymously because we are logged in per the description of the constructor.

Turn it in

Make sure eslint and prettier come back clean.

Push and then tag your work and tell me branch, directory and tag.