File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ interface ImgOptions extends FakeOptions {
3131 * @example
3232 *
3333 * randImg({ grayscale: true }) // return a grayscale image (default is false)
34- *
34+ *
3535 * @example
36- *
36+ *
3737 * randImg({ random: true }) // default is true, prevent the image from being cached
3838 *
3939 */
@@ -56,7 +56,7 @@ export function randImg<Options extends ImgOptions = never>(options?: Options) {
5656 }
5757
5858 return fake (
59- ( ) => `https://picsum.photos/${ width } /${ height } ${ query . toString ( ) } ` ,
59+ ( ) => `https://picsum.photos/${ width } /${ height } ? ${ query . toString ( ) } ` ,
6060 options
6161 ) ;
6262}
Original file line number Diff line number Diff line change @@ -15,4 +15,10 @@ describe('productCategory', () => {
1515 expect ( typeof product . rating . rate ) . toEqual ( 'string' ) ;
1616 expect ( typeof product . rating . count ) . toEqual ( 'string' ) ;
1717 } ) ;
18+
19+ it ( 'should return a proper randImg link' , ( ) => {
20+ const product = randProduct ( ) ;
21+
22+ expect ( product . image ) . toContain ( '?' ) ;
23+ } ) ;
1824} ) ;
You can’t perform that action at this time.
0 commit comments