title: How could I check in JavaScript if the function I am calling is expecting an argument?
body: <p><a href="https://mochajs.org/#test-level" rel="nofollow noreferrer">There is</a> the documentation for Mocha. There is the following code sample:</p>
  <pre><code>it('should take less than 500ms', function (done) {
    this.timeout(500);
    setTimeout(done, 300);
  });
  </code></pre>
  <p>Also, the following test is valid:</p>
  <pre><code>it('should take less than 500ms', function () {
  });
  </code></pre>
  <p>What JavaScript tools does Mocha use to determine if someone will use the <code>done</code> or not?</p>
  <p>E.g. if I have a method:</p>
  <pre><code>function incrementIfExpectsSomething(callback) {
      if(/*callback has a parameter in its definition*/) {
          //increment
      }
  }
  </code></pre>
  <p>How could I implement the <code>/*callback has a parameter in its definition*/</code> part?</p>
  <p>I do not have any applications straight away. I am asking this question just to have a better knowledge of the JavaScript.</p>