From 20451f2898fba90a72c9b953e518e2f67a3bddd7 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Wed, 24 Nov 2021 13:35:34 +0800 Subject: [PATCH] test: add tsd for timing interface (#377) https://github.com/node-modules/urllib/pull/375 --- lib/index.test-d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/index.test-d.ts b/lib/index.test-d.ts index a23f25e6..a3d8d9bd 100644 --- a/lib/index.test-d.ts +++ b/lib/index.test-d.ts @@ -8,3 +8,12 @@ expectType((await curl('http://a.com', {})).data); expectType((await curl('http://a.com', { method: 'HEAD', })).data); + +// HttpClientResponse +const res = await curl('http://a.com'); +expectType(res.res.timing?.queuing); +expectType(res.res.timing?.dnslookup); +expectType(res.res.timing?.connected); +expectType(res.res.timing?.requestSent); +expectType(res.res.timing?.waiting); +expectType(res.res.timing?.contentDownload);