fix(plugins/pagespeed): add placeholder for PWA (#1113) [skip ci]
This commit is contained in:
@@ -331,8 +331,8 @@ export async function imgb64(image, {width, height, fallback = true} = {}) {
|
|||||||
return fallback ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==" : null
|
return fallback ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==" : null
|
||||||
//Load image
|
//Load image
|
||||||
try {
|
try {
|
||||||
//Fix: redirections are not properly supported by jimp (https://github.com/oliver-moran/jimp/issues/909)
|
//Fix: redirections are not properly supported by jimp (https://github.com/oliver-moran/jimp/issues/909), seems to occur only when in jest environment
|
||||||
if (typeof image === "string") {
|
if ((typeof image === "string")&&(process.env.JEST_WORKER_ID)) {
|
||||||
image = (await axios.get(image)).then(response => response.request.responseURL).catch(() => null)
|
image = (await axios.get(image)).then(response => response.request.responseURL).catch(() => null)
|
||||||
console.debug(`metrics/svg/imgb64 > redirected image link to ${image}`)
|
console.debug(`metrics/svg/imgb64 > redirected image link to ${image}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -653,6 +653,7 @@
|
|||||||
{score: faker.datatype.float({max: 1}), title: "Accessibility"},
|
{score: faker.datatype.float({max: 1}), title: "Accessibility"},
|
||||||
{score: faker.datatype.float({max: 1}), title: "Best Practices"},
|
{score: faker.datatype.float({max: 1}), title: "Best Practices"},
|
||||||
{score: faker.datatype.float({max: 1}), title: "SEO"},
|
{score: faker.datatype.float({max: 1}), title: "SEO"},
|
||||||
|
... options["pagespeed.pwa"] ? [{score : faker.datatype.number({max: 1}), title: "PWA"}] : []
|
||||||
],
|
],
|
||||||
metrics: {
|
metrics: {
|
||||||
observedFirstContentfulPaint: faker.datatype.number(500),
|
observedFirstContentfulPaint: faker.datatype.number(500),
|
||||||
|
|||||||
Reference in New Issue
Block a user