Try to fix whois
This commit is contained in:
@@ -98,11 +98,15 @@ test('whois reports bounded timeout message', async (t) => {
|
||||
new Promise((resolve, reject) => {
|
||||
const sig = opts && opts.signal
|
||||
if (sig && typeof sig.addEventListener === 'function') {
|
||||
sig.addEventListener('abort', () => reject(new Error('AbortError')))
|
||||
sig.addEventListener('abort', () => {
|
||||
reject(Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
|
||||
})
|
||||
}
|
||||
void resolve
|
||||
})
|
||||
await run(ctx, ['whois', 'google.com'])
|
||||
t.is(ctx.exitCode, 1)
|
||||
t.ok(ctx._errs.join('\n').includes('network timeout'))
|
||||
const errJoined = ctx._errs.join('\n')
|
||||
t.ok(errJoined.includes('network timeout'))
|
||||
t.ok(errJoined.includes('exceeded 20ms'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user