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

Commit 68620db1 by Jan Aagaard Meier

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

1 parent 9b93aae3
Showing with 7 additions and 8 deletions
...@@ -936,7 +936,6 @@ module.exports = (function() { ...@@ -936,7 +936,6 @@ module.exports = (function() {
DAOFactory.prototype.create = function(values, options) { DAOFactory.prototype.create = function(values, options) {
Utils.validateParameter(values, Object, { optional: true }) Utils.validateParameter(values, Object, { optional: true })
Utils.validateParameter(options, Object, { deprecated: Array, optional: true, index: 2, method: 'DAOFactory#create' }) Utils.validateParameter(options, Object, { deprecated: Array, optional: true, index: 2, method: 'DAOFactory#create' })
if (options instanceof Array) { if (options instanceof Array) {
options = { fields: options } options = { fields: options }
} }
......
...@@ -850,22 +850,22 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -850,22 +850,22 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
}) })
it('does not update timestamps when passing silent=true', function() { it('does not update timestamps when passing silent=true', function() {
this.clock = sinon.useFakeTimers(new Date().getTime());
var self = this var self = this
return this.User.create({ username: 'user' }).then(function (user) { return this.User.create({ username: 'user' }).then(function (user) {
var updatedAt = user.updatedAt var updatedAt = user.updatedAt
self.clock.tick(30000); return new self.sequelize.Promise(function (resolve) {
setTimeout(function () {
return user.updateAttributes({ user.updateAttributes({
username: 'userman' username: 'userman'
}, { }, {
silent: true // silent: true
}).then(function () { }).then(function () {
expect(user.updatedAt).to.equalDate(updatedAt) 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!