Fix `deleteById(id)` and other test failures
This commit is contained in:
parent
b4189bf997
commit
46ff76dda0
|
@ -1284,6 +1284,10 @@ DataAccessObject.removeById = DataAccessObject.destroyById = DataAccessObject.de
|
|||
options = {};
|
||||
}
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
cb = cb || noCallback;
|
||||
|
||||
assert(typeof options === 'object', 'The options argument must be an object');
|
||||
assert(typeof cb === 'function', 'The cb argument must be a function');
|
||||
|
||||
|
|
|
@ -353,6 +353,12 @@ describe('crud-with-options', function () {
|
|||
|
||||
});
|
||||
|
||||
describe('deleteById', function() {
|
||||
it('should allow deleteById(id)', function () {
|
||||
User.deleteById(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('updateAll ', function () {
|
||||
|
||||
beforeEach(seed);
|
||||
|
|
|
@ -14,11 +14,7 @@ describe('events', function() {
|
|||
});
|
||||
});
|
||||
this.shouldEmitEvent = function(eventName, listener, done) {
|
||||
var timeout = setTimeout(function() {
|
||||
done(new Error('did not emit ' + eventName));
|
||||
}, 100);
|
||||
this.TestModel.on(eventName, function() {
|
||||
clearTimeout(timeout);
|
||||
listener.apply(this, arguments);
|
||||
done();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue