title: async callback by define a certain parameter to function like jasmine in javascript?
body: <p>In jasmine, we use a callback function to test async action like this:</p>
  
  <pre><code>it(done =&gt; {
    // ...
  })
  </code></pre>
  
  <p>How can we implement <code>it</code> this action logic? For example, I want to use a function like this:</p>
  
  <pre><code>call(id =&gt; {
    return id
  })
  
  call((id, done) =&gt; {
    setTimeout(() =&gt; done(id), 1000)
  })
  </code></pre>
  
  <p>If there is a <code>done</code> parameter, the function will callback only when <code>done</code> is called.</p>
  
  <p>Could anyone can help to implement this logic?</p>