[test-utils] Make throttleMock more reliable

This commit is contained in:
Pierre-Yves Gérardy 2017-06-13 23:30:12 +02:00
parent 7de0124339
commit 47d59ea68a

View file

@ -14,8 +14,9 @@ module.exports = function() {
} }
}, },
fire: function() { fire: function() {
queue.forEach(function(fn) {fn()}) var tasks = queue
queue.length = 0 queue = []
tasks.forEach(function(fn) {fn()})
}, },
queueLength: function(){ queueLength: function(){
return queue.length return queue.length