How to iterate on array to define the number of promise chains?
<p>I want to add chaining to <code>http.request(url).post(uri)</code> from <code>chai</code> npm module for mocha test feramework.
so I need to add <code>field</code> and <code>attach</code> promises that is for post as long as the values from an array that will pass as parameters for these chai methods
as follow:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var props = ['name:Sara', 'email:sara@mail.com', 'password:pass'];
var route = '/app/login';
    chaiHttp.request(url).post(route)
    ./* add field promises as much as the array length */
    .then(function(res){
      // do something with this res
    });</code></pre>
</div>
</div>
</p>

<p>I do something like this already:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var props = ['name:Sara', 'email:sara@mail.com', 'password:pass'];
var route = '/app/login';
chaiHttp.request(url).post(route).field('name','Sara').field('email','sara@mail.com').then(function(res){
  //do something with response
  });</code></pre>
</div>
</div>
</p>