title: "Expected Spy Log to have Been Called" issue Javascript
body: <p>I am having trouble with passing a test spec (below) that after a fetch failure, the spy log would be called. The failure reference is "Expected spy log to have been called". The function I call within handleErrors will output the expected, so the spy log is the only thing I am trying to understand. Any advice would be greatly appreciated! thank you.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//Test 
    it('should recover on fetch error', function(done){
      window.path = "xyz";
      spyOn(console, "log").and.callFake(function(){});
  
      function check(output) {
        window.path = "xyy";
        expect(console.log).toHaveBeenCalled();
        console.log.calls.reset();
        retrieve().then(function(output){
          var expected = {expectedOutput}
          expect(output).toEqual(expected);
          expect(console.log).not.toHaveBeenCalled();
          done();
        });
      }
  
      retrieve().then(check);
    });
  
  //function 
  function handleErrors(response) {
      if (!response.ok) {
        normalRetrieve()
      }
      return response;
  }
  
  //directly after fetch request
  .then(handleErrors) </code></pre>
  </div>
  </div>
  </p>