[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() {
queue.forEach(function(fn) {fn()})
queue.length = 0
var tasks = queue
queue = []
tasks.forEach(function(fn) {fn()})
},
queueLength: function(){
return queue.length