不要怂,就是干,撸起袖子干!

Commit 604c87db by Ruben Bridgewater

Fix hooks tests

1 parent e31a9e5d
...@@ -490,7 +490,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -490,7 +490,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
fn(new Error('Whoops! Changed user.mood!')); fn(new Error('Whoops! Changed user.mood!'));
}); });
return this.User.create({mood: 'happy'}); return this.User.create({mood: 'happy'}).catch(function(err) {
expect(err).to.be.instanceOf(Error);
});
}); });
}); });
}); });
...@@ -1155,10 +1157,10 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -1155,10 +1157,10 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
A.hasMany(B); A.hasMany(B);
return this.sequelize.sync({force: true}).then(function() { return this.sequelize.sync({force: true}).then(function() {
return [ return this.sequelize.Promise.all([
A.create({name: 'a'}), A.create({name: 'a'}),
B.create({name: 'b'}) B.create({name: 'b'})
].spread(function(a, b) { ]).spread(function(a, b) {
return a.addB(b).then(function() { return a.addB(b).then(function() {
expect(hookCalled).to.equal(1); expect(hookCalled).to.equal(1);
}); });
......
...@@ -210,8 +210,8 @@ describe(Support.getTestDialectTeaser('Includes with schemas'), function() { ...@@ -210,8 +210,8 @@ describe(Support.getTestDialectTeaser('Includes with schemas'), function() {
it('should support an include with multiple different association types', function(done) { it('should support an include with multiple different association types', function(done) {
var self = this; var self = this;
self.sequelize.dropAllSchemas().success(function() { self.sequelize.dropAllSchemas().then(function() {
self.sequelize.createSchema('account').success(function() { self.sequelize.createSchema('account').then(function() {
var AccUser = self.sequelize.define('AccUser', {}, {schema: 'account'}) var AccUser = self.sequelize.define('AccUser', {}, {schema: 'account'})
, Product = self.sequelize.define('Product', { , Product = self.sequelize.define('Product', {
title: DataTypes.STRING title: DataTypes.STRING
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!