Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/falso/src/lib/img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ interface ImgOptions extends FakeOptions {
* @example
*
* randImg({ grayscale: true }) // return a grayscale image (default is false)
*
*
* @example
*
*
* randImg({ random: true }) // default is true, prevent the image from being cached
*
*/
Expand All @@ -56,7 +56,7 @@ export function randImg<Options extends ImgOptions = never>(options?: Options) {
}

return fake(
() => `https://picsum.photos/${width}/${height}${query.toString()}`,
() => `https://picsum.photos/${width}/${height}?${query.toString()}`,
options
);
}
6 changes: 6 additions & 0 deletions packages/falso/src/tests/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ describe('productCategory', () => {
expect(typeof product.rating.rate).toEqual('string');
expect(typeof product.rating.count).toEqual('string');
});

it('should return a proper randImg link', () => {
const product = randProduct();

expect(product.image).toContain('?');
});
});