GitHub Copilot Demo 🚀
This sample repo can be used to generate a quick app with unit tests/mocks and an Actions workflow.
Walkthrough
Have a browser open with the completed code (on main
) as your cheat-sheet.
- Open the
demo-start
branch in a Codespace - Add a new file called
github-wrapper.js
- In a terminal, run
npm install octokit
to install the Octokit package - Create a class/method to get repos for a user
- Open
index.js
and add the method call to the method - Show it running in the browser (browse to the corresponding route)
- Create a new file called
github-wrapper.test.js
- Run
npm install jest --save-dev
to add Jest - Generate a mock Octokit
- Generate the test method
- Open
package.json
and add thetest: jest
command inscripts
- Run
npm run test
to show the test running - Create
.github/workflows/build.yml
- Generate the workflow using Copilot