Skip to content

Commit

Permalink
test: adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Aug 17, 2023
1 parent 86e0918 commit 9665ed5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions packages/astro/test/core-image.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ describe('astro:image', () => {
},
image: {
service: testImageService(),
domains: ['avatars.githubusercontent.com'],
domains: ['astro.build'],
},
});
// Remove cache directory
Expand Down Expand Up @@ -728,12 +728,15 @@ describe('astro:image', () => {
});

it('has cache entries', async () => {
const generatedImages = (await fixture.glob('_astro/**/*.webp')).map((path) =>
basename(path)
);
const cachedImages = (await fixture.glob('../node_modules/.astro/assets/**/*.webp')).map(
(path) => basename(path)
);
const generatedImages = (await fixture.glob('_astro/**/*.webp'))
.map((path) => basename(path))
.sort();
const cachedImages = [
...(await fixture.glob('../node_modules/.astro/assets/**/*.webp')),
...(await fixture.glob('../node_modules/.astro/assets/**/*.json')),
]
.map((path) => basename(path).replace('.webp.json', '.webp'))
.sort();

expect(generatedImages).to.deep.equal(cachedImages);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { Image } from "astro:assets";
---

<div id="remote">
<Image src="https://avatars.githubusercontent.com/u/622227?s=64" alt="fred" width="48" height="48" />
<Image src="https://astro.build/sponsors.png" alt="fred" width="48" height="48" />
</div>

0 comments on commit 9665ed5

Please sign in to comment.