Skip to content

Commit

Permalink
unskip test
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Feb 4, 2025
1 parent c01de38 commit 5bec5e7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/e2e/app-router/e2e/ssr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.skip("Server Side Render and loading.tsx", async ({ page }) => {
}
});

test.skip("Fetch cache properly cached", async ({ page }) => {
test("Fetch cache properly cached", async ({ page }) => {
await page.goto("/ssr");
const originalDate = await page.getByText("Cached fetch:").textContent();
await page.waitForTimeout(2000);
Expand Down
24 changes: 24 additions & 0 deletions test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
async function getCachedValue() {
const resp = await fetch('http://localhost:8790/ssr');
const respTxt = await resp.text();

const regexp = /Cached fetch:.*?GMT/;

const match = respTxt.match(regexp);

return match[0]?.replace("\\\",\\\"", "");
}

console.log('\n');

console.log('cached value 1: ' + await getCachedValue());
// await new Promise(r => setTimeout(r, 2000));
// console.log('cached value 2: ' + await getCachedValue());
// await new Promise(r => setTimeout(r, 2000));
// console.log('cached value 3: ' + await getCachedValue());
// await new Promise(r => setTimeout(r, 2000));
// console.log('cached value 4: ' + await getCachedValue());
// await new Promise(r => setTimeout(r, 2000));
// console.log('cached value 5: ' + await getCachedValue());

console.log('\n');

0 comments on commit 5bec5e7

Please sign in to comment.