Try to fix whois

This commit is contained in:
Raven Scott
2026-04-27 21:00:49 -04:00
parent 9074978c83
commit 60e2efa64a
10 changed files with 60 additions and 32 deletions
@@ -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'))
})