title: Does Protractor support returning Promises in tests?
body: <p>Some test suites support returning Promises in tests to trigger an asynchronous test. The following example would result in a test that passes after 2 seconds if I were using Mocha:</p>
  
  <pre><code>it('async test', function() {
      return new Promise(resolve =&gt; setTimeout(resolve, 2000))
  }
  </code></pre>
  
  <p>As far as I can tell, Protractor uses Jasmine and Jasmine doesn't document that it supports this behavior. Yet if I do this in Protractor, it <em>does</em> work like Mocha does. I know Protractor modifies Jasmine behavior, like making <code>expect(...)</code> wait for Promises, but I can't find any documentation for the above behavior.</p>
  
  <p>What is the source that supports the above behavior? Is it Jasmine, Protractor, or maybe even Selenium? And where is the documentation for this behavior?</p>