Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Latest commit

 

History

History
40 lines (32 loc) · 1.68 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.68 KB

Build Status Coverage Status

project-health

Building

Use npm run build or npm run dev to build the project.

Re-generating github-schema.json

When GitHub's API changes, the corresponding schema needs to be updated. Run the following command to generate the schema from GitHub's introspection API.

$(npm bin)/apollo-codegen introspect-schema https://api.github.com/graphql --output src/types/github-schema.json --header "Authorization: bearer <your token>"

After executing this, build and run tests to ensure everything still functions correctly.

Testing

Run npm run test to execute the tests.

Recording a test

Many aspects of the code base use the GitHub API. To avoid using the GitHub API for testing, tests use a mock server which records and replays GitHub API responses. When adding or modifying a test, you may need to record a test:

  • Supply a token sufficient for your tests.
    export GITHUB_TOKEN="<your personal access token>".
  • Record a single test.
    npm run test:record -- --match 'Your exact testname'

Rebaselining a pixel test

Whenever the UI changes, pixel tests will need to be rebaselined for what to expect. Pixel tests also use recorded data, so ensure you have recorded the test correctly first before rebaselining as follows:

npm run test:rebaseline -- --match 'Your exact pixel testname'