Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.63 KB

HOWTO-run_tests.md

File metadata and controls

49 lines (41 loc) · 1.63 KB

There are current two ways to run tests, using either PostgreSQL or SQLite.

PostgreSQL Testing (default, closer to most prod environments)

  1. Install PostgreSQL
  2. In PostgreSQL, create a database and user named "spoke_test":
CREATE DATABASE spoke_test;
CREATE USER spoke_test WITH PASSWORD 'spoke_test';
GRANT ALL PRIVILEGES ON DATABASE spoke_test TO spoke_test;
  1. Run npm test

SQLite Testing (simpler)

  1. Run npm run test-sqlite

End-To-End (Interactive Browser) Testing

  1. Remember to set NODE_ENV=dev

  2. Start DB and Start Spoke Server as described in the Getting Started section.

  3. Install browser driver(s)

  4. Running tests...

    • ... using your local browser

      npm run test-e2e
      
    • ... individually

      npm run test-e2e <test name>
      
    • ... using Sauce Labs browser with your local host

      Note: You must first setup Sauce Labs

      export SAUCE_USERNAME=<Sauce Labs user name>
      export SAUCE_ACCESS_KEY=<Sauce Labs access key>
      npm run test-e2e <optional test name> --saucelabs