Add this line to
If you will be testing subdomains, you should add an additional line for each subdomain, e.g.:
127.0.0.1 labzero.local.lunch.pink 127.0.0.1 someotherteam.local.lunch.pink
If you want to run integration tests, you will also need to add:
Make two copies of
GOOGLE_* env variables:
- Create a Google Developer app in the console.
- Go to the Credentials section and create an OAuth client ID.
- Click the OAuth Consent tab and add
lunch.pinkas an authorized domain.
- Click the Credentials tab, choose "OAuth" from the Create Credentials dropdown.
- Choose "Web Application" as the type.
- For local development:
https://local.lunch.pink:3000/login/google/callbackas authorized redirect URIs
- Add your deployment target(s) as additional origins/redirect URIs.
- Go back to the Credentials section and create two API keys - one for the client, and one for the server.
- For the client, optionally limit requests to certain referrers.
- On each API key, add
https://*.lunch.pinkas HTTP referrers.
Set up a PostgreSQL database and enter the admin credentials into
.env. If you want to use another database dialect, change it in
After setting up and starting the app, you will be able to log in with this user and create a team. If you did not supply a SUPERUSER_PASSWORD, you will need to log in via OAuth, using the email address you supplied for SUPERUSER_EMAIL.
After setting up your environment:
First, install Yarn. Then:
yarn npx sequelize db:migrate
To seed your database with a Superuser, fill out the
SUPERUSER_* env variables accordingly, then run
npx sequelize db:seed:all
npm start will default to
localhost, but the browser should point to
npm run build
You can modify
tools/deploy.js as needed to work with your deployment strategy.
To run the service worker locally, follow the above steps to run the production server. After testing the service worker, be sure to unregister the service worker in the browser (or close all local Lunch tabs) to avoid issues when testing on the development server.
To run an individual file:
npm run test-file /path/to/file
Testing with coverage
npm run coverage
Make sure your
.env file is filled out. Set up a separate test database using the same user as your development environment. Enter the following into
DB_NAME=your_test_db_name SUPERUSER_NAME=test SUPERUSER_PASSWORD=test SUPERUSER_EMAILfirstname.lastname@example.org
npm run integration
Individual files can be run using:
npm run integration-file path/to/file
Or selected using the Cypress Test Runner in interactive mode:
npm run integration-interactive
npm run lint