Skip to content

Commit

Permalink
artificial delay
Browse files Browse the repository at this point in the history
  • Loading branch information
james-elicx committed May 22, 2024
1 parent 4eb933c commit db458f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages-e2e/features/appFetchCache/fetch-cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeAll, describe, it } from 'vitest';
import { describe, it } from 'vitest';

describe('Simple App server API route with fetch caching', () => {
it('should return a cached fetch response from the suspense cache', async ({
Expand All @@ -12,6 +12,9 @@ describe('Simple App server API route with fetch caching', () => {
expect.not.objectContaining({ 'cf-next-suspense-cache': 'HIT' }),
);

// artificial delay to ensure cache entry updates
await new Promise(res => setTimeout(res, 3000));

const cachedResp = await fetch(`${DEPLOYMENT_URL}/api/cache`);
const cachedRespJson = await cachedResp.json();

Expand Down

0 comments on commit db458f9

Please sign in to comment.