Performance Comparison Tool
# Clone the repo
git clone https://github.com/mozilla/perfcompare.git
cd perfcompare
# Install node modules
npm install
# Runs on localhost:3000 by default
npm run start-dev
In order to contribute to PerfCompare we recommend the following workflow:
- Set an upstream remote that points to the Mozilla PerfCompare's Github repository, in addition to
origin
that points to your fork. - You should then frequently use
git rebase upstream
rather than merging from your fork to keep your branch up to date. There are less conflicts this way and the git history is cleaner.
# Git commands for keeping your branch up to date with the lastest master
git fetch upstream
git rebase upstream/master
git push --force origin <local branch>
We run our JavaScript code in the frontend through ESLint to ensure that new code has a consistent style and doesn't suffer from common errors.
# To run ESLint by itself, you may run the lint task:
npm run lint
# Automatically fix linting issues found (where possible):
npm run lint:fix
# Checking formatting issues with Prettier:
npm run format:check
# Automatically fix format issues found (where possible):
npm run format
Tests can be run with the following commands:
npm run test
# Run tests and watch for changes
npm run test:watch
# Run tests with coverage
npm run test:coverage
When making changes to the UI, snapshots should also be updated to match. Snapshot tests ensure no UI changes occur unexpectedly.
After manually verifying the UI renders as intended, run the following command to update
snapshots:
jest --updateSnapshot
Snapshot files should be included in your pull request(s).