title: Bluebird mapSeries
body: <p>I am trying to execute a series of promises in order, only going to the next one after the previous is resolved. From Bluebird docs: </p>
  
  <blockquote>
    <p>The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled.
    <a href="http://bluebirdjs.com/docs/api/promise.mapseries.html" rel="noreferrer">http://bluebirdjs.com/docs/api/promise.mapseries.html</a></p>
  </blockquote>
  
  <pre><code>var Promise = require('bluebird');
  
  
  function test(time) {
      return new Promise(function(resolve, reject) {
          setTimeout(function() {
              console.log(time);
              resolve(time);
          }, time);
      });
  }
  
  Promise.mapSeries([test(2000), test(1000), test(500), test(3000)], function(a) {
      return a;
  }).then(function(results) {
      console.log(results);
  });
  </code></pre>
  
  <p>What I expect is that the console.log inside the test function to show: 2000, 1000, 500, 3000 in that order. I expect that because as the docs states, each item goes only after the previous is resolved. Instead, I get 500, 1000, 2000, 3000, which reflects that all the functions are called instanstaneously. Moreover, results does show the results in the order they were called, though that is irrelevant at this point.</p>
  
  <p>Am I misunderstanding something here?</p>