Setting up your testing environment - 0Calories/untitled-block-game-api GitHub Wiki

In order to run the project's test suite, you will first have to create a separate testing database.

  1. Navigate to the config directory in your project
  2. Open test.env
  3. Add a new environment variable at the bottom: DATABASE_URL=postgresql://janedoe:mypassword@localhost:5432/mydb
  4. Replace the username and password with your credentials, and change mydb to what you want to name your testing database. I named mine blockgame_test.
  5. Run yarn update-db-test to generate your local testing database
  6. Run yarn test to ensure the tests are working