diff --git a/test-utils/throttleMock.js b/test-utils/throttleMock.js index 46076b28..06e74f99 100644 --- a/test-utils/throttleMock.js +++ b/test-utils/throttleMock.js @@ -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