[test-utils] Make throttleMock more reliable
This commit is contained in:
parent
7de0124339
commit
47d59ea68a
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue