Skip to content

feat(vitest): vitest browser mode #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

manuel3108
Copy link
Member

@manuel3108 manuel3108 commented Jun 9, 2025

Supports vitest browser mode. Makes the setup more flexible by asking the user to add component / unit testing.

Adds a new object.createFromPrimitives to core that should help us find the right balance for #557. We should all object.create calls in the future and try to use this wherever possible.

todo:

  • test in non kit project
  • check if error / warning for The following Vite config options will be overridden by SvelteKit: - root is acurate and how to avoid it

Copy link

changeset-bot bot commented Jun 9, 2025

🦋 Changeset detected

Latest commit: ad89510

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jun 9, 2025

Open in StackBlitz

npx https://pkg.pr.new/sveltejs/cli/sv@588
npx https://pkg.pr.new/sveltejs/cli/svelte-migrate@588

commit: ad89510

if (componentTesting) {
sv.devDependency('@vitest/browser', '^3.2.3');
sv.devDependency('vitest-browser-svelte', '^0.1.0');
sv.devDependency('playwright', '^1.0.0');
Copy link
Member

Choose a reason for hiding this comment

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

would suggest picking the highest available playwright minor here, or at least the one that was available when vitest browser mode was introduced, i am not sure playwright 1.0.0 is actually compatible with it (playwright does breaking changes in minors unfortunately)

Copy link
Member Author

Choose a reason for hiding this comment

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

Does it matter though? Users should always get the latest minor installed, assuming they havn't used playwright in their project before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants