title: Jasmine how to use done()?
body: <p>I'm trying to wrap my head around <code>done()</code> so I can test an asynchronous web service call. The documentation from <a href="https://jasmine.github.io/2.0/introduction.html" rel="nofollow noreferrer">Jasmine</a> and others don't make sense to me, I can't see where the code goes, where the test for completion goes, or where the actual Jasmine tests go. They don't even use any asynchronous calls.</p>
  
  <p>This question previously asked about <code>runs()</code> and <code>waitsFor()</code>, they've been deprecated in 2.0, apparently because <a href="https://groups.google.com/forum/#!topic/jasmine-js/Q_4lyEWrZKI" rel="nofollow noreferrer">"It's much simpler."</a> using <code>done()</code>! In any case, on my version 2.6, using <code>done()</code> anywhere in the code brings up a reference error that it isn't defined, so I'm really not sure what's going on.</p>
  
  <p>This is the code I'd like to be able to adapt. The code to call is <code>helper.send(url, data, params);</code> and the code is done when <code>response !== null</code>.</p>
  
  <pre><code>it ('should be able to invoke a web service with POST as the HTTP method', function() {
      // Data
      let data = {name: 'StackOverflow'};
      // POST
      let params = {method: 'POST'};
      // This call is asynchronous
      // The URL just echoes back the get and post parameters
      request.send(url, data, params);
      // Need to wait for response !== null
      // ...
      // Can now resume tests
      expect(response.post.name).toEqual('StackOverflow');
  });
  </code></pre>
  
  <p>If anyone can help with how to reorganize this to work with <code>done()</code>, it would be much appreciated.</p>