[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() {
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue