title: Jasmin test if callback parameter is called
body: <p>so i have a function which checks if a checksum is changed and if so it calls the callback which is provided by a parameter.</p>
  
  <pre><code>var watchFileChange = function watchFileChange(oldChecksum, callback){
    // some code about checking checksum
    if(oldChecksum != newChecksum){
      callback()
    }
  }
  exports.watchFileChange = watchFileChange;
  </code></pre>
  
  <p>my Jasmin specs looks like this.</p>
  
  <pre><code>var t = require('../server.js');
  describe("watchFileChange", function() {
  
      spyOn(t.watchFileChange, 'Callback');
  
      var file_false = {
        'foo.txt': 'd41dcccc8f00b204e9800998ecf8427e'
      }
      var file_true = {
        'foo.txt': 'd41d8cd98f00b204e9800998ecf8427e'
      }
  
      function Callback() {
        console.log("Callback Called")
      }
  
      it("Checksum is not right, it should call Callback function", function() {
              watchFileChange(file_false, Callback);
              expect(Callback).toHaveBeenCalled();
      });
  
    });
  </code></pre>
  
  <p>But it just doesn't work that way because Callback is not defined i get that. So my question is there a way to check if the by parameter provided callback is called?</p>