diff --git a/src/ui/public/debounce/__tests__/debounce.js b/src/ui/public/debounce/__tests__/debounce.js index 5208365c38a8ff..ef097827e7699e 100644 --- a/src/ui/public/debounce/__tests__/debounce.js +++ b/src/ui/public/debounce/__tests__/debounce.js @@ -15,6 +15,9 @@ function init() { $timeoutSpy = sinon.spy($timeout); debounce = $injector.get('debounce'); + + // ensure there is a clean slate before testing deferred tasks + $timeout.flush(); }); }