title: chai.request attach files array
body: <p>I'm writing a generic test function with chai.request, here is what I have:</p>
  
  <pre><code>//this is in some function
      var file = fs.readFileSync(__dirname + '/../test/files/' + args.fileName);
      chai.request(server)
              .post('/v2')
              .field('email', args.email)
              .field('subject', args.subject)
              .attach('fileName', file, args.fileName)
              .end((err, res) =&gt; {
                  //some test conditions
  
                  done();
              });
  </code></pre>
  
  <p>This works great if there is only 1 file passed, the problem is that sometimes I need to pass in an array of files, but I have no idea how to attach those when I'm not sure of the number of files coming in.</p>
  
  <p><strong>PS:</strong> Some tests require having more than one file passed in at the same time, so simply looping though the entire thing twice will not work, I have to somehow loop through the .attach part only.</p>