Skip to content

Commit

Permalink
Update usage of ttype
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Dec 31, 2023
1 parent c22a001 commit d779078
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/node-test/abort-event-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ test('Abort before sending request (no body)', async (t) => {

const body = new Readable({ read () { } })
body.on('error', (err) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
client.request({
path: '/',
method: 'GET',
signal: ee,
body
}, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})

ee.emit('abort')
Expand Down Expand Up @@ -96,7 +96,7 @@ test('Abort before sending request (no body) async iterator', async (t) => {
signal: ee,
body
}, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})

ee.emit('abort')
Expand All @@ -121,7 +121,7 @@ test('Abort while waiting response (no body)', async (t) => {
t.after(client.destroy.bind(client))

client.request({ path: '/', method: 'GET', signal: ee }, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})

Expand All @@ -145,7 +145,7 @@ test('Abort while waiting response (write headers started) (no body)', async (t)
t.after(client.destroy.bind(client))

client.request({ path: '/', method: 'GET', signal: ee }, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})

Expand All @@ -172,7 +172,7 @@ test('Abort while waiting response (write headers and write body started) (no bo
ee.emit('abort')
})
response.body.on('error', err => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})
})
Expand All @@ -196,7 +196,7 @@ function waitingWithBody (body, type) {
t.after(client.destroy.bind(client))

client.request({ path: '/', method: 'POST', body, signal: ee }, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})
await p.completed
Expand Down Expand Up @@ -226,7 +226,7 @@ function writeHeadersStartedWithBody (body, type) {
t.after(client.destroy.bind(client))

client.request({ path: '/', method: 'POST', body, signal: ee }, (err, response) => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})
await p.completed
Expand Down Expand Up @@ -259,7 +259,7 @@ function writeBodyStartedWithBody (body, type) {
ee.emit('abort')
})
response.body.on('error', err => {
ttype(p, err, errors.RequestAbortedError)
p.ok(ttype(err, errors.RequestAbortedError))
})
})
})
Expand Down

0 comments on commit d779078

Please sign in to comment.