fix(tests): use example.com in image conversion test and relax JPEG size assertion

This commit is contained in:
2026-03-01 19:22:25 +00:00
parent 5bc84ffaa0
commit bd6705ca4a
3 changed files with 10 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ tap.test('should store PNG results from both conversion functions in .nogit/test
});
tap.test('should create a third PDF for image conversion tests', async () => {
const pdfResult = await testSmartPdf.getFullWebsiteAsSinglePdf('https://www.wikipedia.org');
const pdfResult = await testSmartPdf.getFullWebsiteAsSinglePdf('https://example.com');
expect(pdfResult.buffer).toBeInstanceOf(Buffer);
ensureDir('.nogit');
fs.writeFileSync(path.join('.nogit', '3.pdf'), pdfResult.buffer as Buffer);
@@ -283,8 +283,7 @@ tap.test('should compare file sizes between PNG, WebP, and JPEG', async () => {
console.log(`WebP: ${totalWebpSize} bytes (${totalWebpReduction}% reduction)`);
console.log(`JPEG: ${totalJpegSize} bytes (${totalJpegReduction}% reduction)`);
// JPEG and WebP should both be smaller than PNG
expect(totalJpegSize).toBeLessThan(totalPngSize);
// WebP should be smaller than PNG; JPEG may not be for simple graphics pages
expect(totalWebpSize).toBeLessThan(totalPngSize);
});