This guide explains how the All Contributors app is built, how to run and test it locally, and how to keep your local environment aligned with CI.
This guide assumes that you have nvm installed to manage Node versions. It also assumes that you are working in a cloned fork of the all-contributors/app GitHub repository.
To begin, be sure that you are using node version 22 (what we are running in CI), install all dependencies using the package-lock.json lockfile.
# Use Node 22 (same as CI)
nvm install 22
nvm use 22
# Install dependencies specified in the package-lock.json lockfile
npm ciNext, you can run the test suite using npm.
# Run the tests
npm testWe use Jest as our test runner. To update snapshots, which can need to happen when tests change and/or Jest is updated, run:
# Update Jest snapshots
npm test -- -u