canova / perfcompare

Improved Performance Comparison Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PerfCompare

CircleCI codecov

Performance Comparison Tool

screenshot

Setup

Requirements

Installation

# 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

Contributions

In order to contribute to PerfCompare we recommend the following workflow:

  1. Set an upstream remote that points to the Mozilla PerfCompare's Github repository, in addition to origin that points to your fork.
  2. 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>

Validating JavaScript

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

Running Tests

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

Snapshot Tests

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).

About

Improved Performance Comparison Tool


Languages

Language:TypeScript 83.4%Language:JavaScript 12.8%Language:HTML 3.8%