title: How to check if function has a parameter and if it's number
body: <p>I am new to unitTesting and using Mocha/Chai. I am trying to test if the function has a parameter and if it's a number. </p>
  
  <pre><code>// Main Function
  function Sh(partnerUserId) {
  
  
    function validPartnerId(partnerUserId) {
      if (!partnerUserId);
      throw new Error("Missing partnerId");
  
  
      if (isNaN(partnerUserId));
      throw new Error("Not a number");
  
      return true;
    }
  }
  
  
  
  // Unit Test
  
  var expect = chai.expect;
  
  describe("Sh", function() {
  
      it('should check if the partnerId is provided', function(){
          ????
      });
  
  
      it('should check if the partnerId is a number', function(){
         ????
      });
  
  });
  </code></pre>
  
  <p>I am open to suggestions if there is a better way to do it. I am trying to find how to capture the value of an argument and validate it in unit testing. </p>