Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: this.sequelize.runHooks is not a function #92

Open
alisherafat01 opened this issue Dec 27, 2021 · 1 comment
Open

TypeError: this.sequelize.runHooks is not a function #92

alisherafat01 opened this issue Dec 27, 2021 · 1 comment

Comments

@alisherafat01
Copy link

what is the reason of this error?

const UserModel = require('../../../src/models/user');
const Sequelize =require('sequelize');
var SequelizeMock = require('sequelize-mock');
var sequelize = new SequelizeMock();
describe('user.encryptPassword & user.comparePassword', () => {
    it('should encrypt user password and compare with raw password to match', async () => {
        const User = UserModel(sequelize,Sequelize.DataTypes);
        const user = new User();
        user.password = '123456';
        await user.encryptPassword();
        let matched = await user.comparePassword('123456', user.password);
        expect(matched).toBe(true);
    });
});
@officialkevinbrian
Copy link

@alisherafat01 have you found solution bro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants