-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
221 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/kit': patch | ||
--- | ||
|
||
fix: only skip hydration with vite overlay if current page is an error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/adapter-static/test/apps/prerendered/playwright.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { config as default } from '../../utils.js'; |
27 changes: 27 additions & 0 deletions
27
packages/adapter-static/test/apps/prerendered/test/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as fs from 'node:fs'; | ||
import { expect, test } from '@playwright/test'; | ||
|
||
const cwd = process.cwd(); | ||
|
||
test('generates HTML files', () => { | ||
expect(fs.existsSync(`${cwd}/build/index.html`)).toBeTruthy(); | ||
}); | ||
|
||
test('prerenders a page', async ({ page }) => { | ||
await page.goto('/'); | ||
expect(await page.textContent('h1')).toEqual('This page was prerendered'); | ||
expect(await page.textContent('p')).toEqual('answer: 42'); | ||
}); | ||
|
||
test('prerenders an unreferenced endpoint with explicit `prerender` setting', async () => { | ||
expect(fs.existsSync(`${cwd}/build/endpoint/explicit.json`)).toBeTruthy(); | ||
}); | ||
|
||
test('prerenders a referenced endpoint with implicit `prerender` setting', async () => { | ||
expect(fs.existsSync(`${cwd}/build/endpoint/implicit.json`)).toBeTruthy(); | ||
}); | ||
|
||
test('exposes public env vars to the client', async ({ page }) => { | ||
await page.goto('/public-env'); | ||
expect(await page.textContent('h1')).toEqual('The answer is 42'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { config as default } from '../../utils.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as fs from 'node:fs'; | ||
import { expect, test } from '@playwright/test'; | ||
|
||
const cwd = process.cwd(); | ||
|
||
test('generates a fallback page', async ({ page }) => { | ||
expect(fs.existsSync(`${cwd}/build/200.html`)).toBeTruthy(); | ||
|
||
await page.goto('/fallback/a/b/c'); | ||
expect(await page.textContent('h1')).toEqual('the fallback page was rendered'); | ||
}); | ||
|
||
test('does not prerender pages without prerender=true', () => { | ||
expect(fs.existsSync(`${cwd}/build/index.html`)).toBeFalsy(); | ||
}); | ||
|
||
test('prerenders page with prerender=true', () => { | ||
expect(fs.existsSync(`${cwd}/build/about.html`)).toBeTruthy(); | ||
}); | ||
|
||
test('renders content in fallback page when JS runs', async ({ page }) => { | ||
await page.goto('/'); | ||
expect(await page.textContent('h1')).toEqual('This page was not prerendered'); | ||
}); | ||
|
||
test('renders error page for missing page', async ({ page }) => { | ||
await page.goto('/nosuchpage'); | ||
expect(await page.textContent('h1')).toEqual('404'); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.