title: How can you chain supertest requests when one is dependent on the other?
body: <p>So right now the output is:</p>
  
  <pre><code>Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises
  Warning: .end() was called twice. This is not supported in superagent
  GET /api/things 200 3.009 ms - 2414
  superagent: double callback bug
  WARNING
  </code></pre>
  
  <p>The thing is, I need the <code>res</code> object that I get back from calling <code>.end()</code> in order to test the ETag functionality. It never goes into the second <code>.end()</code> and doesn't print out that console log.</p>
  
  <p>The innermost <code>.catch(done)</code> is the one that's being called.</p>
  
  <pre><code>it('should return things', done =&gt; {
    const promises = [];
  
    promises.push(Thing.create(testThing));
    promises.push(Thing.create(testThing));
  
    Promise.all(promises)
      .then(things =&gt; {
        request(app)
          .get('/api/things')
          .expect(200)
          .end((err, res) =&gt; {
            const etag = res.get('ETag')
            if (err)
              return done(err);
            request(app)
              .get('/api/things')
              .set('If-None-Match', etag)
              .expect(304)
              .end((err, res) =&gt; {
                console.log('are we able to make it back here?');
                expect(err).to.not.exist;
                expect(res.body.data).to.be.undefined;
                expect(res.get('ETag')).to.be.equal(etag);
                return done(err);
              })
          })
          .catch(done);
      })
      .catch(done);
  });
  });
  </code></pre>
  
  <p>Does anyone have any ideas on why this might be happening, and how to go about testing such a thing?</p>