diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db93cfc..658091f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: - Node.js 10.x - Node.js 11.x - Node.js 12.x + - Node.js 13.x include: - name: Node.js 0.8 @@ -83,6 +84,9 @@ jobs: - name: Node.js 12.x node-version: "12.22" + - name: Node.js 13.x + node-version: "13.14" + steps: - uses: actions/checkout@v2 diff --git a/test/test.js b/test/test.js index 573e52b..1001f46 100644 --- a/test/test.js +++ b/test/test.js @@ -491,7 +491,20 @@ describe('finalhandler(req, res)', function () { request(server) .get('/foo') - .expect(301, '0', done) + .on('request', function onrequest (test) { + test.req.on('response', function onresponse (res) { + // forward aborts as errors for supertest + res.on('aborted', function onabort () { + res.emit('error', new Error('aborted')) + }) + }) + }) + .end(function (err) { + if (err && err.message !== 'aborted') return done(err) + assert.strictEqual(this.res.statusCode, 301) + assert.strictEqual(this.res.text, '0') + done() + }) }) })