BlinkUX / sequelize-mock

A simple mock interface specifically for testing code relying on Sequelize models
https://sequelize-mock.readthedocs.io
MIT License
139 stars 73 forks source link

Mock model definition is not strict #77

Open amang95 opened 4 years ago

amang95 commented 4 years ago

Hi I made use of const userMock = dbMock.define({ attr1: ' ' attr2: ' '}) But this definition is not strict. By which I mean that: When i try creating a mock object using userMock.create({ attr1: '', attr2: '', attr3:''}) it returns me a user object with all three attributes. Ideally either it should ignore the third attribute as it is not defined or throw some kind of an error. What I noticed with Sequelize was that it does not save that attribute and returns the created object with defined properties. Its unreliable to test sequelize with this issue.