title: How does the qunit knows when the async test callback is complete even though the tests does not return promise?
body: <p>Qunit executes the async tests one by one, but how does it know a test is complete, since the tests does not return a Promise which the qunit can await?</p>
  
  <p>In this demo example <a href="https://jsfiddle.net/6bnLmyof/" rel="nofollow noreferrer">https://jsfiddle.net/6bnLmyof/</a> </p>
  
  <pre><code>function squareAfter1Second(x) {
      const timeout = x * 1000;
      console.log("squareAfter1Second x:", x);
      return new Promise(resolve =&gt; {
          setTimeout(() =&gt; {
              resolve(x * x);
          }, timeout);
      });
  }
  
  const { test } = QUnit;
  
  test( "an async test", async t =&gt; {
      console.log("starting test1");
      t.equal( await squareAfter1Second(3), 9 );
      t.equal( await squareAfter1Second(4), 16 );
  });
  
  test( "an async test2", async t =&gt; {
      console.log("starting test2");
      t.equal( await squareAfter1Second(1), 1 );
  });
  </code></pre>
  
  <p>There are 2 async tests that run one by one. The tests post a macro task (setTimeout) to the event loop, but somehow qunit is able to wait for the test to complete despite the tests not returning promise. Also, in the souce code of <a href="https://code.jquery.com/qunit/qunit-2.9.2.js" rel="nofollow noreferrer">qunit</a> there are no await keywords present.</p>