Skip to content

Commit

Permalink
test: replace t.pass with t.ok
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Feb 8, 2024
1 parent 0a069ab commit 28a41f9
Show file tree
Hide file tree
Showing 30 changed files with 151 additions and 151 deletions.
20 changes: 10 additions & 10 deletions test/client-keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('keep-alive header', (t) => {
t.fail()
}, 4e3)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -76,7 +76,7 @@ test('keep-alive header 0', (t) => {
t.error(err)
body.on('end', () => {
client.on('disconnect', () => {
t.pass()
t.ok(true)
})
clock.tick(600)
}).resume()
Expand Down Expand Up @@ -110,7 +110,7 @@ test('keep-alive header 1', (t) => {
t.fail()
}, 0)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -144,7 +144,7 @@ test('keep-alive header no postfix', (t) => {
t.fail()
}, 4e3)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -180,7 +180,7 @@ test('keep-alive not timeout', (t) => {
t.fail()
}, 3e3)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -217,7 +217,7 @@ test('keep-alive threshold', (t) => {
t.fail()
}, 5e3)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -254,7 +254,7 @@ test('keep-alive max keepalive', (t) => {
t.fail()
}, 3e3)
client.on('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -296,7 +296,7 @@ test('connection close', (t) => {
}, 3e3)
client.once('disconnect', () => {
close = false
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand All @@ -312,7 +312,7 @@ test('connection close', (t) => {
t.fail()
}, 3e3)
client.once('disconnect', () => {
t.pass()
t.ok(true)
clearTimeout(timeout)
})
}).resume()
Expand Down Expand Up @@ -350,7 +350,7 @@ test('Disable keep alive', (t) => {
}, (err, { body }) => {
t.error(err)
body.on('end', () => {
t.pass()
t.ok(true)
}).resume()
})
}).resume()
Expand Down
12 changes: 6 additions & 6 deletions test/client-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ test('pipeline invalid handler return after destroy should not error', (t) => {
t.equal(err.message, 'asd')
})
.on('close', () => {
t.pass()
t.ok(true)
})
.end()
})
Expand Down Expand Up @@ -315,7 +315,7 @@ test('pipeline backpressure', (t) => {
duplex.resume()
})
}).on('end', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down Expand Up @@ -412,7 +412,7 @@ test('pipeline destroy and throw handler', (t) => {
t.type(err, errors.RequestAbortedError)
})
.on('close', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down Expand Up @@ -443,7 +443,7 @@ test('pipeline abort res', (t) => {
}, 100)
client.on('disconnect', () => {
clearTimeout(timeout)
t.pass()
t.ok(true)
})
})
return body
Expand Down Expand Up @@ -789,7 +789,7 @@ test('pipeline legacy stream', (t) => {
})
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
.end()
})
Expand Down Expand Up @@ -896,7 +896,7 @@ test('pipeline body without destroy', (t) => {
})
.end()
.on('end', () => {
t.pass()
t.ok(true)
})
.resume()
})
Expand Down
24 changes: 12 additions & 12 deletions test/client-pipelining.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function errordInflightPost (bodyType) {
serverRes.end()
})
.on('end', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down Expand Up @@ -391,7 +391,7 @@ test('pipelining non-idempotent', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
ended = true
})
})
Expand Down Expand Up @@ -449,7 +449,7 @@ function pipeliningNonIdempotentWithBody (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})

Expand Down Expand Up @@ -504,7 +504,7 @@ function pipeliningHeadBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
body.push(null)
Expand All @@ -525,7 +525,7 @@ function pipeliningHeadBusy (bodyType) {
.resume()
.on('end', () => {
ended = true
t.pass()
t.ok(true)
})
})
body.push(null)
Expand Down Expand Up @@ -575,7 +575,7 @@ test('pipelining empty pipeline before reset', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
t.equal(client[kBusy], false)
Expand All @@ -590,7 +590,7 @@ test('pipelining empty pipeline before reset', (t) => {
.resume()
.on('end', () => {
ended = true
t.pass()
t.ok(true)
})
})
t.equal(client[kBusy], true)
Expand Down Expand Up @@ -628,7 +628,7 @@ function pipeliningIdempotentBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
body.push(null)
Expand All @@ -649,7 +649,7 @@ function pipeliningIdempotentBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
body.push(null)
Expand Down Expand Up @@ -688,7 +688,7 @@ function pipeliningIdempotentBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
body.push(null)
Expand Down Expand Up @@ -734,7 +734,7 @@ test('pipelining blocked', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
client.request({
Expand All @@ -745,7 +745,7 @@ test('pipelining blocked', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/client-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('request post blob', { skip: !Blob }, (t) => {
}, (err, data) => {
t.error(err)
data.body.resume().on('end', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down Expand Up @@ -66,7 +66,7 @@ test('request post arrayBuffer', { skip: !Blob }, (t) => {
}, (err, data) => {
t.error(err)
data.body.resume().on('end', () => {
t.pass()
t.ok(true)
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/client-reconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ test('multiple reconnect', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true)
})
})

client.on('disconnect', () => {
if (++n === 1) {
t.pass()
t.ok(true)
}
process.nextTick(() => {
clock.tick(1000)
Expand Down
Loading

0 comments on commit 28a41f9

Please sign in to comment.