Thanks for wanting to contribute to the Octokit Fixtures, your help is more than welcome. If you have a question about contributing, please open an issue!
A general overview of how Octokit Fixtures work, have a look at HOW_IT_WORKS.md.
Please abide by our Code of Conduct.
Octokit Fixtures require Node 8 in order to run its tests.
The basic setup is
git clone https://github.com/octokit/fixtures.git octokit-fixtures
cd octokit-fixtures
npm install
npm test
GitHub created test user accounts and an organization for the octokit fixtures.
In order to run the bin/record.js
script, you will need to configure the
environment variables listed below. If you need the tokens in order to contribute,
please let us know and we will provide them to you.
octokit-fixture-user-a (user) Main user, has unlimited private repositories |
|
octokit-fixture-user-b (user) Secondary user, private repositories only |
|
octokit-fixture-org (org) Main organization, unlimited private repositories, unlimited seats |
The following access tokens need to be configured as environment variables. You
can create a .env
file to configure them locally, it is parsed using dotenv.
# | Environment variable | User | Description |
---|---|---|---|
1 | FIXTURES_USER_A_TOKEN_FULL_ACCESS | octokit-fixture-user-a | All scopes enabled |
2 | FIXTURES_USER_B_TOKEN_FULL_ACCESS | octokit-fixture-user-b | All scopes enabled |
Run scenarios from scenarios/**
against the real GitHub APIs and compare
responses to previously recorded fixtures
node bin/record
If there are changes, you can updated the recorded fixtures
node bin/record --update
To record selected scenarios, pass their names to the record command.
You can combine that with the --update
flag.
node bin/record api.github.com/get-root api.github.com/get-repository
In case you created temporary repositories that you want to delete all at once:
node bin/remove-temporary-repositories
Run integration & unit tests with
npm test
After running tests, a coverage report can be generated that can be browsed locally.
npm run coverage
Releases are automated using semantic-release. The following commit message conventions determine which version is released:
fix: ...
orfix(scope name): ...
prefix in subject: bumps fix version, e.g.1.2.3
→1.2.4
feat: ...
orfeat(scope name): ...
prefix in subject: bumps feature version, e.g.1.2.3
→1.3.0
BREAKING CHANGE:
in body: bumps breaking version, e.g.1.2.3
→2.0.0
Only one version number is bumped at a time, the highest version change trumps the others.