Skip to content

Commit

Permalink
test(types): _buildURL & _buildSrcSet return strings
Browse files Browse the repository at this point in the history
  • Loading branch information
luqven committed Apr 21, 2022
1 parent ed2cc2b commit 06572c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ expectType<number[]>(ImgixClient.targetWidths(minWidth, maxWidth, widthTol));
expectType<number[]>(
ImgixClient.targetWidths(minWidth, maxWidth, widthTol, cache),
);

const absoluteURL = 'https://test.imgix.net/image.jpg';

expectType<string>(ImgixClient._buildURL(absoluteURL, params, {}));
expectType<string>(ImgixClient._buildURL(absoluteURL, params, buildURLOptions));

expectType<string>(ImgixClient._buildSrcSet(absoluteURL));
expectType<string>(ImgixClient._buildSrcSet(absoluteURL, params));
expectType<string>(
ImgixClient._buildSrcSet(absoluteURL, params, srcsetOptions),
);

0 comments on commit 06572c8

Please sign in to comment.