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

Attributes option in queries does not filter resulting objects attributes #11

Open ghost opened 7 years ago

ghost commented 7 years ago

Associations are working well, but I notice another thing: when we write something like this: userMock.findOne({where:{id:1},attributes:['name','username']}) we get a whole Sequelize model of user, so attributes doesn't work This is a bug or so conceived?

LoveAndCoding commented 7 years ago

At the moment the attributes option is not supported by our result generation system when querying.

With v0.8 and above, you can use the result queue to return an object with only the specified values. See our Mock Query documentation for more information on how to do that.

VinozzZ commented 6 years ago

Hey I can't seem to get the association to work in my test. Can anyone help me on that>