docs: document Vitest SSR environment requirement for Astro 6
Description (required)
This PR documents a breaking change in Astro 6 where rendering .astro components in Vitest tests now requires using an SSR environment (node) instead of client environments (jsdom/happy-dom).
The temporary workaround added in Astro 5.x has been removed to ensure tests run in an environment that matches Astro's SSR build process.
What's included:
- Clear identification of who is affected (all three conditions must apply: Vitest + Container API + client environment)
- Explanation that users not rendering Astro components or already using
nodeenvironment need no changes - Step-by-step migration guide with code examples
- Workspace configuration example for projects needing multiple test environments
Related issues & labels (optional)
- Closes withastro/astro#14895
For Astro version: 6.0. See astro PR #14941.
Deploy Preview for astro-docs-2 ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | 1c8627553947403b60f8fe5058d664ce6d7b5564 |
| Latest deploy log | https://app.netlify.com/projects/astro-docs-2/deploys/69458c42a02473000870a566 |
| Deploy Preview | https://deploy-preview-12808--astro-docs-2.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Lunaria Status Overview
🌕 This pull request will trigger status changes.
Learn more
By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.
You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.
Tracked Files
| File | Note |
|---|---|
| en/guides/upgrade-to/v6.mdx | Localization changed, will be marked as complete. |
Warnings reference
| Icon | Description |
|---|---|
| 🔄️ | The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied. |
@delucis I'd really appreciate your guidance and review on this PR. If there's anything that needs adjustment to better match the docs style or if I've missed any important details, please let me know. Happy to iterate on this!
Just resolved the conflicts here, and noting that it looks like we're waiting on movement on the implementation PR which is marked as needs response. Just want to make sure the feature PR is active and the author is addressing feedback!
Just a note that I have:
- committed a suggestion to update the title of this entry, so that I could also update the link to the v6 upgrade guide in the astro PR
- reviewed and lightly edited Florian's suggestions so that all suggestions can be accepted as is
- removed the
merge on releaselabel because it seems like the code was already merged intonext? (but, without a changeset which is now the PR linked in the description above). This can likely merge at any time
Looks like what's needed here in order to merge:
- [x] all of Florian's suggestions should be committed
- [ ] according to Florian, the example is deprecated usage and should be updated to show current usage
Update: We are merging this because there is going to be a release with the merged code so we need something published in the upgrade guide!
If someone wants to improve this entry at a later date, then they can do so in another PR to the v6 branch! But we at least need something published now. :smile:
@sarah11918 am so sorry for the delay i wasnt online at that time. Thank you guys for Helping out!