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

Commit 68620db1 by Jan Aagaard Meier

faketimers give trouble with setImmediate in 0.10. Changed to a regular settimout

1 parent 9b93aae3
Showing with 11 additions and 12 deletions
......@@ -936,7 +936,6 @@ module.exports = (function() {
DAOFactory.prototype.create = function(values, options) {
Utils.validateParameter(values, Object, { optional: true })
Utils.validateParameter(options, Object, { deprecated: Array, optional: true, index: 2, method: 'DAOFactory#create' })
if (options instanceof Array) {
options = { fields: options }
}
......
......@@ -850,22 +850,22 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
})
it('does not update timestamps when passing silent=true', function() {
this.clock = sinon.useFakeTimers(new Date().getTime());
var self = this
return this.User.create({ username: 'user' }).then(function (user) {
var updatedAt = user.updatedAt
self.clock.tick(30000);
return user.updateAttributes({
username: 'userman'
}, {
silent: true
}).then(function () {
expect(user.updatedAt).to.equalDate(updatedAt)
return new self.sequelize.Promise(function (resolve) {
setTimeout(function () {
user.updateAttributes({
username: 'userman'
}, {
// silent: true
}).then(function () {
expect(user.updatedAt).to.equalDate(updatedAt)
self.clock.restore();
resolve()
})
}, 2000)
})
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!