Updated abort behavior (#1141)

* Updated abort behavior

- Support for aborting a request with the promise api
- Aborting a request will cause a RequestAbortedError
- Normalized Connection class errors, now every error returned is
wrapped by the client errors constructors

* Updated test

* Updated docs

* Updated code generation script

* Renamed test

* Code coverage

* Avoid calling twice transport.request
This commit is contained in:
Tomas Della Vedova
2020-04-06 11:21:19 +02:00
committed by GitHub
parent 953a8033ab
commit 27a8e2a9bf
16 changed files with 824 additions and 648 deletions

View File

@ -135,7 +135,7 @@ test('Abort method (callback)', t => {
})
})
test('Abort is not supported in promises', t => {
test('Abort method (promises)', t => {
t.plan(2)
function handler (req, res) {
@ -160,7 +160,7 @@ test('Abort is not supported in promises', t => {
})
.catch(t.fail)
t.type(request.abort, 'undefined')
t.type(request.abort, 'function')
})
})