Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jordanell/testing-with-sequelize
An example repository for how to test with the Sequelize ORM.
https://github.com/jordanell/testing-with-sequelize
chai mocha nodejs sequelize
Last synced: 2 months ago
JSON representation
An example repository for how to test with the Sequelize ORM.
- Host: GitHub
- URL: https://github.com/jordanell/testing-with-sequelize
- Owner: jordanell
- License: mit
- Created: 2018-07-23T21:58:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T02:26:59.000Z (over 1 year ago)
- Last Synced: 2024-10-31T08:52:21.467Z (2 months ago)
- Topics: chai, mocha, nodejs, sequelize
- Language: JavaScript
- Size: 1.22 MB
- Stars: 30
- Watchers: 3
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testing-with-sequelize
An example repository for how to test with the Sequelize ORM.
## Development
A quick guide to get a new development environment setup
### Setup
**Node**
1. Install [nvm][] with:
```bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash`.
2. Install Node `8.11.2` with:
```bash
nvm install 8.11.2
```
3. From the root directory of this project, run
```bash
nvm use 8.11.2
```
4. Install NPM packages:
```bash
npm install
```
[nvm]: https://github.com/nvm-sh/nvm**Database**
1. Install PostgreSQL on your local machine. Use Homebrew as below or go to the [Postgres Downloads](https://www.postgresql.org/download/) page.
```bash
$ brew install postgresql
```2. Start PostgreSQL and run on startup.
```bash
$ brew services start postgresql
```3. Ensure a `root` user exists on PostgreSQL with no password:
```console
$ psql --dbname=postgres
postgres=# CREATE USER root;
postgres=# ALTER USER root WITH SUPERUSER;
```4. Create the database by running:
```bash
$ NODE_ENV=test npm run db:create
```### Testing
Run the test suite:
```bash
$ npm run test
```