A mocking interface designed for testing code that uses Sequelize.
Documentation at sequelize-mock.readthedocs.io
npm i sequelize-mock --save-dev
The Mock Models created with this library function as drop in replacements for your unit testing.
Start by importing the library
var SequelizeMock = ;
Initialize the library as you would Sequelize
var DBConnectionMock = ;
Define your models
var UserMock = DBConnectionMock;
Once Mock models have been defined, you can use them as drop-in replacements for your Sequelize model objects. Data is not retrieved from a database and instead is returned based on the setup of the mock objects, the query being made, and other applied or included information.
For example, your code might look something like this
This library is under active development, so you should feel free to submit issues, questions, or pull requests.
Created by Blink UX and licensed under the MIT license. Check the LICENSE file for more information.