# Contributing * [Requirements & local setup](#requirements--local-setup) * [Test users / organization / tokens](#test-users--organization--tokens) * [Record](#record) * [Tests](#tests) * [Coverage](#coverage) 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](HOW_IT_WORKS.md). Please abide by our [Code of Conduct](CODE_OF_CONDUCT.md). ## Requirements & local setup 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 ``` ## Test users / organization / tokens 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](https://www.npmjs.com/package/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
## Record 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 ``` ## Tests Run integration & unit tests with ``` npm test ``` ## Coverage After running tests, a coverage report can be generated that can be browsed locally. ``` npm run coverage ``` ## Releases Releases are automated using [semantic-release](https://github.com/semantic-release/semantic-release). The following commit message conventions determine which version is released: 1. `fix: ...` or `fix(scope name): ...` prefix in subject: bumps fix version, e.g. `1.2.3` → `1.2.4` 2. `feat: ...` or `feat(scope name): ...` prefix in subject: bumps feature version, e.g. `1.2.3` → `1.3.0` 3. `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.