Skip to content

Commit 0810680

Browse files
committed
test(filterWatcher): test clear cache manually
1 parent 7de51e9 commit 0810680

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/spec/provider/watcher.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
describe('filterWatcherProvider', function() {
4-
54
//helpers
65
function n(n) { return n; }
76
var stub = { fn: function(x) { return n(x) } };
@@ -56,4 +55,14 @@ describe('filterWatcherProvider', function() {
5655
});
5756
expect(spy.callCount).toEqual(10);
5857
}));
58+
59+
it('should clear cache manually', function() {
60+
window.setTimeout = function(cb) { cb(); };
61+
inject(function(filterWatcher) {
62+
var src = [1,2]
63+
, result = [3,4];
64+
filterWatcher.memoize('fName', src, null, result);
65+
expect(filterWatcher.isMemoized('fName', src)).toBeFalsy();
66+
});
67+
});
5968
});

0 commit comments

Comments
 (0)