title: How to use Promises in Postman tests?
body: <p>I need to use some async code in my Postman test. </p>
  
  <p>As it's a complex scenario I've reproduced the scenario in a very simple test with the following code: </p>
  
  <pre><code>let promiseNumber = 0;
  
  function resolvedPromise() {
      return new Promise((resolve, reject) =&gt; {
          pm.sendRequest('https://postman-echo.com/get', (err, res) =&gt; {
              if (err) {
                  console.log(err);
                  reject();
              } else {
                  console.log(`Resolved promise ${++promiseNumber}`);
                  resolve();
              }
          });
      });
  }
  
  resolvedPromise()
      .then(resolvedPromise)
      .then(resolvedPromise)
      .catch(err =&gt; console.log(err));
  </code></pre>
  
  <p>The expected result on the console would be: </p>
  
  <pre><code>Resolved promise 1
  Resolved promise 2
  Resolved promise 3
  </code></pre>
  
  <p>But instead I receive:</p>
  
  <pre><code>Resolved promise 1
  </code></pre>
  
  <p>Is there a way to make Promises or async code available at Postman?</p>