Skip to content

hasHook throws exception if specified hook doesn't exist #3181

@shaunerikson

Description

@shaunerikson

using 2.0.0-rc8

describe('#hasHook', function() {

    describe('specified hook does not exist', function() {

        it('should return true but throws an exception (BUG ???)', function(done) {
            var Model = sequelize.define('Model', { 
                name: Sequelize.STRING 
            });
            try {
                var result = Model.hasHook('beforeCreate'); 
                // Never get to here...
                expect(result).to.be.false;
                done();
            } catch (error) {
                done(error);
            }
        });
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions