Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: replace t.pass with t.ok #2721

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, 'pass')
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, 'pass')
})
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, 'pass')
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, 'pass')
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, 'pass')
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, 'pass')
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, 'pass')
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, 'pass')
clearTimeout(timeout)
})
}).resume()
Expand All @@ -312,7 +312,7 @@ test('connection close', (t) => {
t.fail()
}, 3e3)
client.once('disconnect', () => {
t.pass()
t.ok(true, 'pass')
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, 'pass')
}).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, 'pass')
})
.end()
})
Expand Down Expand Up @@ -315,7 +315,7 @@ test('pipeline backpressure', (t) => {
duplex.resume()
})
}).on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})
})
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, 'pass')
})
})
})
Expand Down Expand Up @@ -443,7 +443,7 @@ test('pipeline abort res', (t) => {
}, 100)
client.on('disconnect', () => {
clearTimeout(timeout)
t.pass()
t.ok(true, 'pass')
})
})
return body
Expand Down Expand Up @@ -789,7 +789,7 @@ test('pipeline legacy stream', (t) => {
})
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
.end()
})
Expand Down Expand Up @@ -896,7 +896,7 @@ test('pipeline body without destroy', (t) => {
})
.end()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
.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, 'pass')
})
})
})
Expand Down Expand Up @@ -391,7 +391,7 @@ test('pipelining non-idempotent', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
ended = true
})
})
Expand Down Expand Up @@ -449,7 +449,7 @@ function pipeliningNonIdempotentWithBody (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})

Expand Down Expand Up @@ -504,7 +504,7 @@ function pipeliningHeadBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})
body.push(null)
Expand All @@ -525,7 +525,7 @@ function pipeliningHeadBusy (bodyType) {
.resume()
.on('end', () => {
ended = true
t.pass()
t.ok(true, 'pass')
})
})
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, 'pass')
})
})
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, 'pass')
})
})
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, 'pass')
})
})
body.push(null)
Expand All @@ -649,7 +649,7 @@ function pipeliningIdempotentBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})
body.push(null)
Expand Down Expand Up @@ -688,7 +688,7 @@ function pipeliningIdempotentBusy (bodyType) {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})
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, 'pass')
})
})
client.request({
Expand All @@ -745,7 +745,7 @@ test('pipelining blocked', (t) => {
data.body
.resume()
.on('end', () => {
t.pass()
t.ok(true, 'pass')
})
})
})
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, 'pass')
})
})
})
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, 'pass')
})
})
})
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, 'pass')
})
})

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