sequelize-mock
sequelize-mock copied to clipboard
Feature Request - Model.findByPk
Sequelize 5.x removed findById and added findByPk can this be added to Sequelize mock?
Still waiting on this. For now I've patched my tests with things like this:
const dbMock = new SequelizeMock();
const User = dbMock.define('user');
User.findByPk = async (id: string | number, options: any) => {
return User.findOne({
where: {
id,
},
...options,
});
};