[ci] format

This commit is contained in:
tony-sull 2022-09-01 15:01:07 +00:00 committed by fredkbot
parent aeae89d6ae
commit ef0ed38339
7 changed files with 155 additions and 157 deletions

View file

@ -25,13 +25,13 @@ describe('SSG images - dev', function () {
title: 'Local images',
id: '#social-jpg',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' }
query: { f: 'jpg', w: '506', h: '253' },
},
{
title: 'Inline imports',
id: '#inline',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' }
query: { f: 'jpg', w: '506', h: '253' },
},
{
title: 'Remote images',
@ -41,15 +41,15 @@ describe('SSG images - dev', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' }
}
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' },
},
].forEach(({ title, id, url, query }) => {
it(title, () => {
const image = $(id);
@ -89,13 +89,13 @@ describe('SSG images with subpath - dev', function () {
title: 'Local images',
id: '#social-jpg',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' }
query: { f: 'jpg', w: '506', h: '253' },
},
{
title: 'Inline imports',
id: '#inline',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' }
query: { f: 'jpg', w: '506', h: '253' },
},
{
title: 'Remote images',
@ -105,15 +105,15 @@ describe('SSG images with subpath - dev', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' }
}
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' },
},
].forEach(({ title, id, url, query }) => {
it(title, () => {
const image = $(id);
@ -157,26 +157,26 @@ describe('SSG images - build', function () {
title: 'Local images',
id: '#social-jpg',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Inline imports',
id: '#inline',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Remote images',
id: '#google',
regex: /^\/googlelogo_color_272x92dp_\w{4,10}.webp/,
size: { width: 544, height: 184, type: 'webp' }
size: { width: 544, height: 184, type: 'webp' },
},
{
title: 'Public images',
id: '#hero',
regex: /^\/hero_\w{4,10}.webp/,
size: { width: 768, height: 414, type: 'webp' }
}
size: { width: 768, height: 414, type: 'webp' },
},
].forEach(({ title, id, regex, size }) => {
it(title, () => {
const image = $(id);
@ -184,10 +184,10 @@ describe('SSG images - build', function () {
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
verifyImage(image.attr('src'), size);
})
})
});
});
});
describe('SSG images with subpath - build', function () {
@ -215,26 +215,26 @@ describe('SSG images with subpath - build', function () {
title: 'Local images',
id: '#social-jpg',
regex: /^\/docs\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Inline imports',
id: '#inline',
regex: /^\/docs\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Remote images',
id: '#google',
regex: /^\/docs\/googlelogo_color_272x92dp_\w{4,10}.webp/,
size: { width: 544, height: 184, type: 'webp' }
size: { width: 544, height: 184, type: 'webp' },
},
{
title: 'Public images',
id: '#hero',
regex: /^\/docs\/hero_\w{4,10}.webp/,
size: { width: 768, height: 414, type: 'webp' }
}
size: { width: 768, height: 414, type: 'webp' },
},
].forEach(({ title, id, regex, size }) => {
it(title, () => {
const image = $(id);
@ -242,8 +242,8 @@ describe('SSG images with subpath - build', function () {
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
verifyImage(image.attr('src').replace('/docs', ''), size);
})
});
});
});

View file

@ -14,19 +14,19 @@ describe('SSR images - build', async function () {
});
await fixture.build();
});
[
{
title: 'Local images',
id: '#social-jpg',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ }
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ },
},
{
title: 'Inline imports',
id: '#inline',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ }
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ },
},
{
title: 'Remote images',
@ -36,8 +36,8 @@ describe('SSR images - build', async function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
},
{
title: 'Remote images with search',
@ -47,15 +47,15 @@ describe('SSR images - build', async function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png?token=abc'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png?token=abc',
},
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' }
}
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' },
},
].forEach(({ title, id, url, query }) => {
it(title, async () => {
const app = await fixture.loadTestAdapterApp();
@ -103,13 +103,13 @@ describe('SSR images with subpath - build', function () {
title: 'Local images',
id: '#social-jpg',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ }
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ },
},
{
title: 'Inline imports',
id: '#inline',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ }
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ },
},
{
title: 'Remote images',
@ -119,8 +119,8 @@ describe('SSR images with subpath - build', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
},
{
title: 'Remote images with search',
@ -130,15 +130,15 @@ describe('SSR images with subpath - build', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png?token=abc'
}
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png?token=abc',
},
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' }
}
query: { f: 'webp', w: '768', h: '414', href: '/hero.jpg' },
},
].forEach(({ title, id, url, query }) => {
it(title, async () => {
const app = await fixture.loadTestAdapterApp();

View file

@ -47,7 +47,7 @@ describe('SSR images - dev', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
contentType: 'image/webp',
},
@ -59,10 +59,10 @@ describe('SSR images - dev', function () {
f: 'webp',
w: '768',
h: '414',
href: '/hero.jpg'
href: '/hero.jpg',
},
contentType: 'image/webp',
}
},
].forEach(({ title, id, url, query, contentType }) => {
it(title, async () => {
const image = $(id);
@ -131,7 +131,7 @@ describe('SSR images with subpath - dev', function () {
f: 'webp',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
contentType: 'image/webp',
},
@ -143,10 +143,10 @@ describe('SSR images with subpath - dev', function () {
f: 'webp',
w: '768',
h: '414',
href: '/hero.jpg'
href: '/hero.jpg',
},
contentType: 'image/webp',
}
},
].forEach(({ title, id, url, query, contentType }) => {
it(title, async () => {
const image = $(id);

View file

@ -28,14 +28,14 @@ describe('SSG pictures - dev', function () {
id: '#social-jpg',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
id: '#inline',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -45,16 +45,16 @@ describe('SSG pictures - dev', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'jpg', w: '768', h: '414', href: '/hero.jpg' },
alt: 'Hero image'
alt: 'Hero image',
},
].forEach(({ title, id, url, query, alt }) => {
it(title, () => {
@ -62,7 +62,7 @@ describe('SSG pictures - dev', function () {
expect(sources.length).to.equal(3);
const image = $(`${id} img`);
const src = image.attr('src');
const [route, params] = src.split('?');
@ -101,14 +101,14 @@ describe('SSG pictures with subpath - dev', function () {
id: '#social-jpg',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
id: '#inline',
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -118,16 +118,16 @@ describe('SSG pictures with subpath - dev', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'jpg', w: '768', h: '414', href: '/hero.jpg' },
alt: 'Hero image'
alt: 'Hero image',
},
].forEach(({ title, id, url, query, alt }) => {
it(title, () => {
@ -135,7 +135,7 @@ describe('SSG pictures with subpath - dev', function () {
expect(sources.length).to.equal(3);
const image = $(`${id} img`);
const src = image.attr('src');
const [route, params] = src.split('?');
@ -184,60 +184,59 @@ describe('SSG pictures - build', function () {
id: '#social-jpg',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline images',
id: '#inline',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
id: '#google',
regex: /^\/googlelogo_color_272x92dp_\w{4,10}.png/,
size: { width: 544, height: 184, type: 'png' },
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
regex: /^\/hero_\w{4,10}.jpg/,
size: { width: 768, height: 414, type: 'jpg' },
alt: 'Hero image'
}
]
.forEach(({ title, id,regex, size, alt }) => {
it(title, () => {
const sources = $(`${id} source`);
expect(sources.length).to.equal(3);
const image = $(`${id} img`);
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
expect(image.attr('alt')).to.equal(alt);
verifyImage(image.attr('src'), size);
alt: 'Hero image',
},
].forEach(({ title, id, regex, size, alt }) => {
it(title, () => {
const sources = $(`${id} source`);
expect(sources.length).to.equal(3);
sources.each((_, el) => {
const source = $(el);
const srcset = source.attr('srcset');
const image = $(`${id} img`);
for (const src of srcset.split(',')) {
const [pathname, width] = src.split(' ');
const widthNum = parseInt(width.substring(0, width.length - 1));
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
expect(image.attr('alt')).to.equal(alt);
verifyImage(pathname, {
width: widthNum,
height: widthNum === size.width ? size.height : Math.round(size.height / 2),
type: path.extname(pathname).substring(1)
})
}
})
verifyImage(image.attr('src'), size);
sources.each((_, el) => {
const source = $(el);
const srcset = source.attr('srcset');
for (const src of srcset.split(',')) {
const [pathname, width] = src.split(' ');
const widthNum = parseInt(width.substring(0, width.length - 1));
verifyImage(pathname, {
width: widthNum,
height: widthNum === size.width ? size.height : Math.round(size.height / 2),
type: path.extname(pathname).substring(1),
});
}
});
});
});
});
@ -273,59 +272,58 @@ describe('SSG pictures with subpath - build', function () {
id: '#social-jpg',
regex: /^\/docs\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline images',
id: '#inline',
regex: /^\/docs\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
id: '#google',
regex: /^\/docs\/googlelogo_color_272x92dp_\w{4,10}.png/,
size: { width: 544, height: 184, type: 'png' },
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
regex: /^\/docs\/hero_\w{4,10}.jpg/,
size: { width: 768, height: 414, type: 'jpg' },
alt: 'Hero image'
}
]
.forEach(({ title, id,regex, size, alt }) => {
it(title, () => {
const sources = $(`${id} source`);
expect(sources.length).to.equal(3);
const image = $(`${id} img`);
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
expect(image.attr('alt')).to.equal(alt);
verifyImage(image.attr('src').replace('/docs', ''), size);
alt: 'Hero image',
},
].forEach(({ title, id, regex, size, alt }) => {
it(title, () => {
const sources = $(`${id} source`);
expect(sources.length).to.equal(3);
sources.each((_, el) => {
const source = $(el);
const srcset = source.attr('srcset');
const image = $(`${id} img`);
for (const src of srcset.split(',')) {
const [pathname, width] = src.split(' ');
const widthNum = parseInt(width.substring(0, width.length - 1))
expect(image.attr('src')).to.match(regex);
expect(image.attr('width')).to.equal(size.width.toString());
expect(image.attr('height')).to.equal(size.height.toString());
expect(image.attr('alt')).to.equal(alt);
verifyImage(pathname.replace('/docs', ''), {
width: widthNum,
height: widthNum === size.width ? size.height : Math.round(size.height / 2),
type: path.extname(pathname).substring(1)
})
}
})
verifyImage(image.attr('src').replace('/docs', ''), size);
sources.each((_, el) => {
const source = $(el);
const srcset = source.attr('srcset');
for (const src of srcset.split(',')) {
const [pathname, width] = src.split(' ');
const widthNum = parseInt(width.substring(0, width.length - 1));
verifyImage(pathname.replace('/docs', ''), {
width: widthNum,
height: widthNum === size.width ? size.height : Math.round(size.height / 2),
type: path.extname(pathname).substring(1),
});
}
});
});
});
});

View file

@ -21,14 +21,14 @@ describe('SSR pictures - build', function () {
id: '#social-jpg',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
id: '#inline',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/assets\/social.\w{8}.jpg/ },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -38,17 +38,17 @@ describe('SSR pictures - build', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'jpg', w: '768', h: '414', href: '/hero.jpg' },
alt: 'Hero image'
}
alt: 'Hero image',
},
].forEach(({ title, id, url, query }) => {
it(title, async () => {
const app = await fixture.loadTestAdapterApp();
@ -101,14 +101,14 @@ describe('SSR pictures with subpath - build', function () {
id: '#social-jpg',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ },
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
id: '#inline',
url: '/_image',
query: { f: 'jpg', w: '506', h: '253', href: /^\/docs\/assets\/social.\w{8}.jpg/ },
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -118,17 +118,17 @@ describe('SSR pictures with subpath - build', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
id: '#hero',
url: '/_image',
query: { f: 'jpg', w: '768', h: '414', href: '/hero.jpg' },
alt: 'Hero image'
}
alt: 'Hero image',
},
].forEach(({ title, id, url, query }) => {
it(title, async () => {
const app = await fixture.loadTestAdapterApp();

View file

@ -31,7 +31,7 @@ describe('SSR pictures - dev', function () {
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
contentType: 'image/jpeg',
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
@ -39,7 +39,7 @@ describe('SSR pictures - dev', function () {
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
contentType: 'image/jpeg',
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -49,10 +49,10 @@ describe('SSR pictures - dev', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
contentType: 'image/png',
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
@ -62,11 +62,11 @@ describe('SSR pictures - dev', function () {
f: 'jpg',
w: '768',
h: '414',
href: '/hero.jpg'
href: '/hero.jpg',
},
contentType: 'image/jpeg',
alt: 'Hero image'
}
alt: 'Hero image',
},
].forEach(({ title, id, url, query, alt, contentType }) => {
it(title, async () => {
const sources = $(`${id} source`);
@ -125,7 +125,7 @@ describe('SSR pictures with subpath - dev', function () {
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
contentType: 'image/jpeg',
alt: 'Social image'
alt: 'Social image',
},
{
title: 'Inline imports',
@ -133,7 +133,7 @@ describe('SSR pictures with subpath - dev', function () {
url: '/@astroimage/assets/social.jpg',
query: { f: 'jpg', w: '506', h: '253' },
contentType: 'image/jpeg',
alt: 'Inline social image'
alt: 'Inline social image',
},
{
title: 'Remote images',
@ -143,10 +143,10 @@ describe('SSR pictures with subpath - dev', function () {
f: 'png',
w: '544',
h: '184',
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
href: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
},
contentType: 'image/png',
alt: 'Google logo'
alt: 'Google logo',
},
{
title: 'Public images',
@ -156,11 +156,11 @@ describe('SSR pictures with subpath - dev', function () {
f: 'jpg',
w: '768',
h: '414',
href: '/hero.jpg'
href: '/hero.jpg',
},
contentType: 'image/jpeg',
alt: 'Hero image'
}
alt: 'Hero image',
},
].forEach(({ title, id, url, query, alt, contentType }) => {
it(title, async () => {
const sources = $(`${id} source`);

View file

@ -29,26 +29,26 @@ describe('Images in MDX - build', function () {
title: 'Local images',
id: '#social-jpg',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Inline imports',
id: '#inline',
regex: /^\/social.\w{8}_\w{4,10}.jpg/,
size: { width: 506, height: 253, type: 'jpg' }
size: { width: 506, height: 253, type: 'jpg' },
},
{
title: 'Remote images',
id: '#google',
regex: /^\/googlelogo_color_272x92dp_\w{4,10}.webp/,
size: { width: 544, height: 184, type: 'webp' }
size: { width: 544, height: 184, type: 'webp' },
},
{
title: 'Public images',
id: '#hero',
regex: /^\/hero_\w{4,10}.webp/,
size: { width: 768, height: 414, type: 'webp' }
}
size: { width: 768, height: 414, type: 'webp' },
},
].forEach(({ title, id, regex, size }) => {
it(title, () => {
const image = $(id);