Permalink
Browse files

[test] call $timeout.flush() before debounce tests

* Otherwise, the '$http GET' to fetch translation resources
shows up as a deferred task here.

* Referenced from:
srl295@5d9959c
  • Loading branch information...
hickeyma committed Feb 21, 2017
1 parent 6728f9f commit 91f27f69a03eb74f4a84d2f628b8f5584b9d2a70
Showing with 3 additions and 0 deletions.
  1. +3 −0 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();
});
}

0 comments on commit 91f27f6

Please sign in to comment.