Skip to content

Conversation

@Ntale3
Copy link

@Ntale3 Ntale3 commented Nov 27, 2025

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 node environment need no changes
  • Step-by-step migration guide with code examples
  • Workspace configuration example for projects needing multiple test environments

Related issues & labels (optional)

For Astro version: 6.0. See astro PR #15049.

@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1c86275
🔍 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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Nov 27, 2025

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.

@Ntale3
Copy link
Author

Ntale3 commented Nov 27, 2025

@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!

@sarah11918 sarah11918 added this to the v6.0.0 docs milestone Dec 10, 2025
@sarah11918
Copy link
Member

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!

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending a PR! A few suggestions

});
```

If you need to test both Astro components and browser-specific code, use Vitest's workspace configuration to separate them:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workspaces are deprecated, can you update this sentence and the codeblock below to show usage with projects? https://vitest.dev/guide/projects

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ntale3 Just making sure you see this comment from Florian! Once this example is updated, I think this PR (and the other Astro changeset one) will be ready to merge! 🥳

@sarah11918 sarah11918 added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Dec 18, 2025
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
@sarah11918
Copy link
Member

sarah11918 commented Dec 19, 2025

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 release label because it seems like the code was already merged into next? (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:

  • all of Florian's suggestions should be committed
  • according to Florian, the example is deprecated usage and should be updated to show current usage

@sarah11918 sarah11918 removed the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Dec 19, 2025
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
@sarah11918
Copy link
Member

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. 😄

@sarah11918 sarah11918 merged commit c897c87 into withastro:v6 Dec 19, 2025
10 checks passed
@Ntale3
Copy link
Author

Ntale3 commented Dec 19, 2025

@sarah11918 am so sorry for the delay i wasnt online at that time.
Thank you guys for Helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants