An example repository for how to test with the Sequelize ORM.
A quick guide to get a new development environment setup
Node
- Install nvm with:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash`.
- Install Node
8.11.2
with:nvm install 8.11.2
- From the root directory of this project, run
nvm use 8.11.2
- Install NPM packages:
npm install
Database
-
Install PostgreSQL on your local machine. Use Homebrew as below or go to the Postgres Downloads page.
$ brew install postgresql
-
Start PostgreSQL and run on startup.
$ brew services start postgresql
-
Ensure a
root
user exists on PostgreSQL with no password:$ psql --dbname=postgres postgres=# CREATE USER root; postgres=# ALTER USER root WITH SUPERUSER;
-
Create the database by running:
$ NODE_ENV=test npm run db:create
Run the test suite:
$ npm run test