Skip to content

Commit

Permalink
Handle case where Vite already knows about save
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Sep 3, 2024
1 parent f73f356 commit 27f3654
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/astro/test/content-layer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ describe('Content Layer', () => {
let json;
before(async () => {
devServer = await fixture.startDevServer({ force: true });
await fixture.onNextDataStoreChange();
// Vite may not have noticed the saved data store yet. Wait a little just in case.
await fixture.onNextDataStoreChange(1000).catch(() => {
// Ignore timeout, because it may have saved before we get here.
})
const rawJsonResponse = await fixture.fetch('/collections.json');
const rawJson = await rawJsonResponse.text();
json = devalue.parse(rawJson);
Expand Down

0 comments on commit 27f3654

Please sign in to comment.