Skip to content

Commit

Permalink
Add test for AVIF input asset
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrossman committed Sep 2, 2023
1 parent 6e2ba68 commit c0be387
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/astro/test/astro-assets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,12 @@ describe('Assets', () => {
const data = await fixture.readFile(src);
expect(!!data).to.equal(true);
});

it('built the avif image', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
const src = $('#avif').attr('src');
const data = await fixture.readFile(src);
expect(!!data).to.equal(true);
});
});
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import p1Url from '../images/penguin1.jpg';
import p2Url from '../images/penguin2.jpg?url';
import p3Url from '../images/penguin3.avif'
---
<html lang="en">
<head><title>This Site</title></head>
Expand All @@ -22,5 +23,6 @@ import p2Url from '../images/penguin2.jpg?url';

<img src={p1Url.src} id="import-no-url" />
<img src={p2Url} id="import-url" />
<img src={p3Url.src} id="avif" />
</body>
</html>

0 comments on commit c0be387

Please sign in to comment.