Skip to content

Commit

Permalink
chore: update faker functions (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Jul 25, 2023
1 parent cea9e43 commit eedfb04
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
18 changes: 9 additions & 9 deletions source/app/web/statics/embed/app.placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
forks: faker.number.int(1000),
releases: faker.number.int(1000),
},
diskUsage: `${faker.datatype.float({min: 1, max: 999}).toFixed(1)}MB`,
diskUsage: `${faker.number.float({min: 1, max: 999}).toFixed(1)}MB`,
registration: `${faker.number.int({min: 2, max: 10})} years ago`,
cakeday: false,
calendar: new Array(14).fill(null).map(_ => ({color: faker.helpers.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])})),
Expand Down Expand Up @@ -274,7 +274,7 @@
? {
user: {
commits: faker.number.int(100),
percentage: faker.datatype.float({max: 1}),
percentage: faker.number.float({max: 1}),
maintainer: false,
stars: faker.number.int(100),
},
Expand Down Expand Up @@ -679,10 +679,10 @@
url: options["pagespeed.url"] || "(attached website url)",
detailed: options["pagespeed.detailed"] || false,
scores: [
{score: faker.datatype.float({max: 1}), title: "Performance"},
{score: faker.datatype.float({max: 1}), title: "Accessibility"},
{score: faker.datatype.float({max: 1}), title: "Best Practices"},
{score: faker.datatype.float({max: 1}), title: "SEO"},
{score: faker.number.float({max: 1}), title: "Performance"},
{score: faker.number.float({max: 1}), title: "Accessibility"},
{score: faker.number.float({max: 1}), title: "Best Practices"},
{score: faker.number.float({max: 1}), title: "SEO"},
...options["pagespeed.pwa"] ? [{score: faker.number.int({max: 1}), title: "PWA"}] : [],
],
metrics: {
Expand All @@ -695,12 +695,12 @@
maxPotentialFID: faker.number.int(500),
observedLoad: faker.number.int(500),
firstMeaningfulPaint: faker.number.int(500),
observedCumulativeLayoutShift: faker.datatype.float({max: 1}),
observedCumulativeLayoutShift: faker.number.float({max: 1}),
observedSpeedIndex: faker.number.int(1000),
observedSpeedIndexTs: faker.date.recent(),
observedTimeOriginTs: faker.date.recent(),
observedLargestContentfulPaint: faker.number.int(1000),
cumulativeLayoutShift: faker.datatype.float({max: 1}),
cumulativeLayoutShift: faker.number.float({max: 1}),
observedFirstPaintTs: faker.date.recent(),
observedTraceEndTs: faker.date.recent(),
largestContentfulPaint: faker.number.int(2000),
Expand Down Expand Up @@ -1326,7 +1326,7 @@
isocalendar: {
streak: {max: 30 + faker.number.int(20), current: faker.number.int(30)},
max: 10 + faker.number.int(40),
average: faker.datatype.float(10),
average: faker.number.float(10),
svg: await staticPlaceholder(set.plugins.enabled.isocalendar, `isocalendar.${options["isocalendar.duration"]}.svg`),
duration: options["isocalendar.duration"],
},
Expand Down
24 changes: 12 additions & 12 deletions tests/mocks/api/axios/get/lastfm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ export default function({faker, url, options, login = faker.internet.userName()}
image: [
{
size: "small",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "medium",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "large",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "extralarge",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
],
streamable: "0",
Expand Down Expand Up @@ -86,19 +86,19 @@ export default function({faker, url, options, login = faker.internet.userName()}
image: [
{
size: "small",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "medium",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "large",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "extralarge",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
],
url: faker.internet.url(),
Expand Down Expand Up @@ -130,19 +130,19 @@ export default function({faker, url, options, login = faker.internet.userName()}
image: [
{
size: "small",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "medium",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "large",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
{
size: "extralarge",
"#text": faker.image.abstract(),
"#text": faker.image.urlLoremFlickr({ category: 'abstract' }),
},
],
streamable: "0",
Expand Down
12 changes: 6 additions & 6 deletions tests/mocks/api/axios/get/pagespeed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export default function({faker, url, options, login = faker.internet.userName()}
maxPotentialFID: faker.number.int(500),
observedLoad: faker.number.int(500),
firstMeaningfulPaint: faker.number.int(500),
observedCumulativeLayoutShift: faker.datatype.float({max: 1}),
observedCumulativeLayoutShift: faker.number.float({max: 1}),
observedSpeedIndex: faker.number.int(1000),
observedSpeedIndexTs: faker.date.recent(),
observedTimeOriginTs: faker.date.recent(),
observedLargestContentfulPaint: faker.number.int(1000),
cumulativeLayoutShift: faker.datatype.float({max: 1}),
cumulativeLayoutShift: faker.number.float({max: 1}),
observedFirstPaintTs: faker.date.recent(),
observedTraceEndTs: faker.date.recent(),
largestContentfulPaint: faker.number.int(2000),
Expand Down Expand Up @@ -78,22 +78,22 @@ export default function({faker, url, options, login = faker.internet.userName()}
"best-practices": {
id: "best-practices",
title: "Best Practices",
score: faker.datatype.float({max: 1}),
score: faker.number.float({max: 1}),
},
seo: {
id: "seo",
title: "SEO",
score: faker.datatype.float({max: 1}),
score: faker.number.float({max: 1}),
},
accessibility: {
id: "accessibility",
title: "Accessibility",
score: faker.datatype.float({max: 1}),
score: faker.number.float({max: 1}),
},
performance: {
id: "performance",
title: "Performance",
score: faker.datatype.float({max: 1}),
score: faker.number.float({max: 1}),
},
pwa: {
id: "pwa",
Expand Down
18 changes: 9 additions & 9 deletions tests/mocks/api/axios/get/spotify.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export default function({faker, url, options, login = faker.internet.userName()}
images: [
{
height: 640,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 640,
},
{
height: 300,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 300,
},
{
height: 64,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 64,
},
],
Expand Down Expand Up @@ -81,17 +81,17 @@ export default function({faker, url, options, login = faker.internet.userName()}
images: [
{
height: 640,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 640,
},
{
height: 300,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 300,
},
{
height: 64,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 64,
},
],
Expand Down Expand Up @@ -126,17 +126,17 @@ export default function({faker, url, options, login = faker.internet.userName()}
images: [
{
height: 640,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 640,
},
{
height: 300,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 300,
},
{
height: 64,
url: faker.image.abstract(),
url: faker.image.urlLoremFlickr({ category: 'abstract' }),
width: 64,
},
],
Expand Down
6 changes: 3 additions & 3 deletions tests/mocks/api/axios/post/leetcode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export default function({faker, url, body, login = faker.internet.userName()}) {
],
matchedUser: {
problemsSolvedBeatsStats: [
{difficulty: "Easy", percentage: faker.datatype.float({max: 100})},
{difficulty: "Medium", percentage: faker.datatype.float({max: 100})},
{difficulty: "Hard", percentage: faker.datatype.float({max: 100})},
{difficulty: "Easy", percentage: faker.number.float({max: 100})},
{difficulty: "Medium", percentage: faker.number.float({max: 100})},
{difficulty: "Hard", percentage: faker.number.float({max: 100})},
],
submitStatsGlobal: {
acSubmissionNum: [
Expand Down

0 comments on commit eedfb04

Please sign in to comment.