RequestCacheService docs & tests

This commit is contained in:
Art Lowel
2017-03-14 14:36:03 +01:00
parent eaaf12d645
commit 34d9aece7e
4 changed files with 217 additions and 3 deletions

View File

@@ -72,9 +72,10 @@ describe("ObjectCacheService", () => {
it("should not return a cached object that has exceeded its time to live", () => {
spyOn(store, 'select').and.returnValue(Observable.of(invalidCacheEntry));
let testObj: any;
service.get(uuid, TestClass).take(1).subscribe(o => testObj = o);
expect(testObj).toBeUndefined();
let getObsHasFired = false;
const subscription = service.get(uuid, TestClass).subscribe(o => getObsHasFired = true);
expect(getObsHasFired).toBe(false);
subscription.unsubscribe();
});
});