title: qunit how to test ajax call
body: <p>Just discovered Qunit and I'm writing some tests for the firs time. Now this might be a weird question, but here goes. If I have a function that reads json data from a file, how do I test it? I could mock the actual getJSON as suggested <a href="https://stackoverflow.com/questions/9384292/qunit-how-to-test-ajax-call-without-modifying-the-ajax-call">here</a>.
   but wouldn't that defeat the purpose of the test? I mean the file could be missing, empty, filled with non valid JSON,...  So if I mock the getJSON I can't test that. Or am I looking at it wrong and should this function not be tested at all since I'm providing the file?</p>
  
  <pre><code>function GetJSONFromFile(){
    var fileData;
    $.getJSON( "js/file.json", function(data) {   
      fileData = data;        
    })
    .fail(function(jqxhr, textStatus, error) {
      var err = textStatus + ", " + error;
      console.log(err);
    });   
    return fileData;
  }
  </code></pre>