title: Unit testing a function that does not return anything in Javascript
body: <p>As topic suggested, how can I unit test a function that does not return anything (apart from null checks that simply returns)?</p>
  
  <p>And also, how do I unit test the functions within a function which also does not return anything especially if they are at the last lines of a function?</p>
  
  <p>The reason behind this question is that I've been trying to use Jack and JsMockito to test my code, and they all required me to provide some sort of object which seems to be returned by a function in the code, hence I'm lost on how to do so.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Here is a sample pesudo code:</p>
  
  <pre><code>function myFunction()
  {
      local var
  
      null check {
          return;
      }
  
      null check
      {
          return;
      }
  
      // points to another function
      function(param1);
  
      // points to a C# function
      function(param1, param2);
  }
  </code></pre>