https://github.com/nielssteensma/sequelize-typescript-mock-examples
Examples of mocking sequelize-typescript models with Jest.
https://github.com/nielssteensma/sequelize-typescript-mock-examples
jest mock sequelize-typescript testing
Last synced: over 1 year ago
JSON representation
Examples of mocking sequelize-typescript models with Jest.
- Host: GitHub
- URL: https://github.com/nielssteensma/sequelize-typescript-mock-examples
- Owner: NielsSteensma
- License: mit
- Created: 2019-06-03T18:39:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-03T10:07:39.000Z (over 2 years ago)
- Last Synced: 2023-12-03T11:22:10.356Z (over 2 years ago)
- Topics: jest, mock, sequelize-typescript, testing
- Language: TypeScript
- Homepage:
- Size: 123 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Examples of mocking Sequelize-Typescript models with Jest
[](https://travis-ci.com/NielsSteensma/sequelize-typescript-mock-examples)
[](https://renovatebot.com/)
Mocking your models is a great way to test your application without actually hitting the database. This repository shows how you can do this for sequelize-typescript package.
#### Some reasons why you want to mock your models:
- You can check if all arguments where correctly passed to the ORM.
- You can return own defined resultsets from a mocked database call.
#### Guide
To see how you can create mocks for your models check out the test folder inside this repository.