Conversation
case sensitive
|
There was a problem hiding this comment.
Pull request overview
This PR makes small fixes to improve developer experience around Qwik error links and to adjust how the SSG snapshot e2e test reads/updates its expected outputs.
Changes:
- Update the Qwik error documentation anchor URL to use a lowercase
#qfragment. - Refactor the SSG snapshot e2e test to load expected snapshot content earlier and allow updating in-place.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/qwik/src/core/shared/error/error.ts | Adjusts the base URL fragment used when linking error codes to the docs page. |
| e2e/qwik-e2e/tests/qwikrouter/ssg-snapshot.e2e.ts | Changes snapshot read/update flow and variable mutability during UPDATE mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let expectedHtml = (await readFile(expectedHtmlPath, 'utf-8')).replace(/\r\n/g, '\n'); | ||
| let expectedState = (await readFile(expectedStatePath, 'utf-8')).replace(/\r\n/g, '\n'); | ||
|
|
||
| warnIfSizeChanged('readable state dump', expectedState, normalizedState); | ||
| warnIfSizeChanged('HTML', expectedHtml, normalizedHtml); | ||
|
|
||
| if (process.env.UPDATE_SSG_SNAPSHOT === '1') { | ||
| await writeFile(expectedHtmlPath, normalizedHtml, 'utf-8'); | ||
| await writeFile(expectedStatePath, normalizedState, 'utf-8'); | ||
| expectedHtml = normalizedHtml; | ||
| expectedState = normalizedState; |
There was a problem hiding this comment.
When UPDATE_SSG_SNAPSHOT=1, the test now reads the existing snapshot files and calls warnIfSizeChanged before writing the updated snapshots. This makes snapshot-update runs noisy (warnings even though changes are intentional) and also regresses the ability to bootstrap/update snapshots when the expected files don't exist yet (readFile will throw before writeFile can create them). Consider handling UPDATE_SSG_SNAPSHOT first (write + set expected to normalized) and only reading/warning when not updating (or only warning if the expected files were successfully read).
| let expectedHtml = (await readFile(expectedHtmlPath, 'utf-8')).replace(/\r\n/g, '\n'); | |
| let expectedState = (await readFile(expectedStatePath, 'utf-8')).replace(/\r\n/g, '\n'); | |
| warnIfSizeChanged('readable state dump', expectedState, normalizedState); | |
| warnIfSizeChanged('HTML', expectedHtml, normalizedHtml); | |
| if (process.env.UPDATE_SSG_SNAPSHOT === '1') { | |
| await writeFile(expectedHtmlPath, normalizedHtml, 'utf-8'); | |
| await writeFile(expectedStatePath, normalizedState, 'utf-8'); | |
| expectedHtml = normalizedHtml; | |
| expectedState = normalizedState; | |
| let expectedHtml: string; | |
| let expectedState: string; | |
| if (process.env.UPDATE_SSG_SNAPSHOT === '1') { | |
| await writeFile(expectedHtmlPath, normalizedHtml, 'utf-8'); | |
| await writeFile(expectedStatePath, normalizedState, 'utf-8'); | |
| expectedHtml = normalizedHtml; | |
| expectedState = normalizedState; | |
| } else { | |
| expectedHtml = (await readFile(expectedHtmlPath, 'utf-8')).replace(/\r\n/g, '\n'); | |
| expectedState = (await readFile(expectedStatePath, 'utf-8')).replace(/\r\n/g, '\n'); | |
| warnIfSizeChanged('readable state dump', expectedState, normalizedState); | |
| warnIfSizeChanged('HTML', expectedHtml, normalizedHtml); |
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
No description provided.