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
|
||||
//Load image
|
||||
try {
|
||||
//Fix: redirections are not properly supported by jimp (https://github.com/oliver-moran/jimp/issues/909)
|
||||
if (typeof image === "string") {
|
||||
//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")&&(process.env.JEST_WORKER_ID)) {
|
||||
image = (await axios.get(image)).then(response => response.request.responseURL).catch(() => null)
|
||||
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: "Best Practices"},
|
||||
{score: faker.datatype.float({max: 1}), title: "SEO"},
|
||||
... options["pagespeed.pwa"] ? [{score : faker.datatype.number({max: 1}), title: "PWA"}] : []
|
||||
],
|
||||
metrics: {
|
||||
observedFirstContentfulPaint: faker.datatype.number(500),
|
||||
|
||||
Reference in New Issue
Block a user