Skip to content

Commit

Permalink
Merge branch 'release/1.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Jul 30, 2022
2 parents 86e1d81 + 7d60f76 commit e68fea1
Show file tree
Hide file tree
Showing 4 changed files with 2,672 additions and 2,701 deletions.
50 changes: 17 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
version: 2
version: 2.1

jobs:
build:
docker:
- image: circleci/node:latest
orbs:
node: circleci/[email protected]
codecov: codecov/[email protected]

jobs:
test:
executor:
name: node/default
tag: 'current'
steps:
- checkout

- restore_cache:
keys:
- dependencies-v2-{{ checksum "package.json" }}

- run:
name: Install global packages
command: sudo npm install -g codecov

- run:
name: Install dependencies
command: npm install

- save_cache:
key: dependencies-v2-{{ checksum "package.json" }}
paths:
- node_modules

- node/install-packages
- run:
name: Javascript Linter
command: npm run lint

- run:
name: All Unit Tests with Code Coverage
name: Unit tests with code coverage
command: npm run test:unit:cov

# Far too flakey to run on CI
# - run:
# name: Mutation Tests
# command: npm run test:mutants

- run:
name: Send reports to codecov.io
command: codecov
workflows:
node-tests:
jobs:
- test:
post-steps:
- codecov/upload
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const model = (sequelize, DataTypes) => {
age: {
type: DataTypes.INTEGER.UNSIGNED
},
firstname: {
firstName: {
type: DataTypes.STRING,
allowNull: false,
validate: {
notEmpty: true
}
},
lastname: {
lastName: {
type: DataTypes.STRING,
allowNull: false,
validate: {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('src/models/User', () => {
checkModelName(User)('User')

context('properties', () => {
;['age', 'firstname', 'lastname', 'email', 'token'].forEach(checkPropertyExists(user))
;['age', 'firstName', 'lastName', 'email', 'token'].forEach(checkPropertyExists(user))
})

context('associations', () => {
Expand All @@ -141,7 +141,7 @@ describe('src/models/User', () => {
})

context('non unique (and also composite in this example)', () => {
;[['firstname', 'lastname']].forEach(checkNonUniqueIndex(user))
;[['firstName', 'lastName']].forEach(checkNonUniqueIndex(user))
})
})
})
Expand Down Expand Up @@ -247,8 +247,8 @@ describe('src/utils/save', () => {

const id = 1
const data = {
firstname: 'Testy',
lastname: 'McTestface',
firstName: 'Testy',
lastName: 'McTestFace',
email: 'testy.mctestface.test.tes',
token: 'some-token'
}
Expand Down Expand Up @@ -301,7 +301,7 @@ describe('src/utils/save', () => {
})
```

As a convenience, `makeMockModels` will automatically populate your `mockModels` with mocks of all of the models defined in your `src/models` folder (or if you have a `.sequelizerc` file it will look for the `model-path` in that). Simply override any of the specific models you need to do stuff with.
As a convenience, `makeMockModels` will automatically populate your `mockModels` with mocks of all of the models defined in your `src/models` folder (or if you have a `.sequelizerc` file it will look for the `models-path` in that). Simply override any of the specific models you need to do stuff with.

### Testing models created with `Model.init`

Expand Down Expand Up @@ -378,7 +378,7 @@ const { listModels } = require('sequelize-test-helpers')
console.log(listModels()) // will spit out a list of your model names.
```

Similarly to `makeMockModels` above, `listModels` will find all of the models defined in your `src/models` folder (or if you have a `.sequelizerc` file it will look for the `model-path` in that).
Similarly to `makeMockModels` above, `listModels` will find all of the models defined in your `src/models` folder (or if you have a `.sequelizerc` file it will look for the `models-path` in that).

## Custom `models` paths and custom file suffixes

Expand Down Expand Up @@ -406,9 +406,9 @@ By default `makeMockModels` and `listModels` will both look for your models in f
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/develop) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/develop) | Work in progress |
| `main` | [![CircleCI](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main.svg?style=svg)](https://circleci.com/gh/davesag/sequelize-test-helpers/tree/main) | [![codecov](https://codecov.io/gh/davesag/sequelize-test-helpers/branch/main/graph/badge.svg)](https://codecov.io/gh/davesag/sequelize-test-helpers) | [![Vulnerabilities](https://snyk.io/test/github/davesag/sequelize-test-helpers/main/badge.svg)](https://snyk.io/test/github/davesag/sequelize-test-helpers/main) | Latest stable release |

### Prerequisites
### Development Prerequisites

- [NodeJS](htps://nodejs.org). I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.
- [NodeJS](https://nodejs.org). I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.

### Initialisation

Expand Down
Loading

0 comments on commit e68fea1

Please sign in to comment.