Skip to content

Commit

Permalink
test: add tsd for timing interface (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Nov 24, 2021
1 parent f662c2b commit 20451f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ expectType<Buffer>((await curl<Buffer>('http://a.com', {})).data);
expectType<string>((await curl<string>('http://a.com', {
method: 'HEAD',
})).data);

// HttpClientResponse
const res = await curl<Buffer>('http://a.com');
expectType<number | undefined>(res.res.timing?.queuing);
expectType<number | undefined>(res.res.timing?.dnslookup);
expectType<number | undefined>(res.res.timing?.connected);
expectType<number | undefined>(res.res.timing?.requestSent);
expectType<number | undefined>(res.res.timing?.waiting);
expectType<number | undefined>(res.res.timing?.contentDownload);

0 comments on commit 20451f2

Please sign in to comment.