Example #1
0
 beforeEach(() => {
   clock = sinon.useFakeTimers();
   clock.tick(100);
   instance = new Feed();
   store = {dispatch: sinon.spy()};
   instance.connectStore(store);
   const promise = new Promise(resolve => {
     resolvePromise = resolve;
   });
   instance.getData = sinon.spy(() => promise);
   refreshPromise = instance.refresh();
 });
Example #2
0
 it("should catch error if .store is not defined", () => {
   instance = new Feed();
   instance.getData = () => Promise.resolve();
   return instance.refresh();
 });
Example #3
0
 it("should catch error if .getData is not defined", () => {
   instance = new Feed();
   instance.connectStore(store);
   return instance.refresh();
 });