Skip to content

chore(deps): upgrade vitest from 0.34 to 4.0#823

Merged
hugoattal merged 1 commit intohistoire-dev:mainfrom
Kapcash:feature/update-vitest
Jan 7, 2026
Merged

chore(deps): upgrade vitest from 0.34 to 4.0#823
hugoattal merged 1 commit intohistoire-dev:mainfrom
Kapcash:feature/update-vitest

Conversation

@Kapcash
Copy link
Copy Markdown
Contributor

@Kapcash Kapcash commented Dec 26, 2025

Description

When creating unit tests for #822, I've realized the vitest version was quite old. It's not compatible with the VSCode Vitest extension.

So I just upgraded it and ensured all unit tests passes.
The snapshot format changed so I've updated them.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Dec 26, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 26, 2025

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit b8bdef5
🔍 Latest deploy log https://app.netlify.com/projects/histoire-examples-svelte3/deploys/694e80414f4da70008b90bcc
😎 Deploy Preview https://deploy-preview-823--histoire-examples-svelte3.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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 26, 2025

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit b8bdef5
🔍 Latest deploy log https://app.netlify.com/projects/histoire-site/deploys/694e8041e722700008a5cc94
😎 Deploy Preview https://deploy-preview-823--histoire-site.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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 26, 2025

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit b8bdef5
🔍 Latest deploy log https://app.netlify.com/projects/histoire-controls/deploys/694e8041da2e5a0008941a9e
😎 Deploy Preview https://deploy-preview-823--histoire-controls.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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 26, 2025

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit b8bdef5
🔍 Latest deploy log https://app.netlify.com/projects/histoire-examples-vue3/deploys/694e8041acb2b80008411c7a
😎 Deploy Preview https://deploy-preview-823--histoire-examples-vue3.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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Kapcash, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a crucial maintenance task: upgrading the project's testing framework, Vitest, to its latest major version. The primary motivation behind this update is to enhance developer experience by ensuring compatibility with the VSCode Vitest extension, which was previously hindered by an outdated version. The upgrade involved updating the Vitest dependency in core packages and subsequently refreshing all related transitive dependencies, along with necessary adjustments to existing test snapshots to conform to the new format. This change ensures the testing infrastructure remains modern, stable, and integrated with current development tools.

Highlights

  • Vitest Upgrade: The core testing framework, Vitest, has been significantly upgraded from version "0.34.6" to "4.0.16" across the histoire-controls and histoire packages.
  • VSCode Extension Compatibility: This upgrade resolves compatibility issues with the VSCode Vitest extension, improving the developer experience for unit testing.
  • Snapshot Updates: Due to changes in the Vitest snapshot format, existing test snapshots have been updated to align with the new version.
  • Dependency Refresh: The pnpm-lock.yaml file reflects a comprehensive update of numerous transitive dependencies, ensuring the project uses more current and potentially more secure versions of its underlying packages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades vitest from version 0.34.6 to 4.0.16. The changes are straightforward, involving updates to package.json files, the pnpm-lock.yaml file, and test snapshots. The snapshot updates are expected due to format changes in the new version of vitest. This is a welcome maintenance update that keeps the project's dependencies current. The changes look correct and I have no further comments.

@Kapcash Kapcash changed the title chore: upgrade vitest from 0.34 to 4.0 chore(deps): upgrade vitest from 0.34 to 4.0 Dec 26, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 27, 2025

Open in StackBlitz

histoire

npm i https://pkg.pr.new/histoire-dev/histoire@823

@histoire/app

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/app@823

@histoire/controls

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/controls@823

@histoire/plugin-nuxt

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-nuxt@823

@histoire/plugin-percy

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-percy@823

@histoire/plugin-screenshot

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-screenshot@823

@histoire/plugin-svelte

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-svelte@823

@histoire/plugin-vue

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-vue@823

@histoire/shared

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/shared@823

@histoire/vendors

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/vendors@823

commit: b8bdef5

Copy link
Copy Markdown
Collaborator

@hugoattal hugoattal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for contributing 😄 !

@@ -1,9 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`HstCheckbox > toggle to checked 1`] = `"<label class=\\"histoire-wrapper htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap histoire-checkbox htw-cursor-pointer htw-items-center\\" role=\\"checkbox\\" tabindex=\\"0\\"><span class=\\"htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0 v-popper--has-tooltip\\">Label</span><span class=\\"htw-grow htw-max-w-full htw-flex htw-items-center htw-gap-1\\"><span class=\\"htw-block htw-grow htw-max-w-full\\"><div class=\\"histoire-simple-checkbox htw-group htw-text-white htw-w-[16px] htw-h-[16px] htw-relative\\"><div class=\\"htw-border htw-border-solid group-active:htw-bg-gray-500/20 htw-rounded-sm htw-box-border htw-absolute htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out group-hover:htw-border-primary-500 group-hover:dark:htw-border-primary-500 htw-border-black/25 dark:htw-border-white/25 htw-delay-150\\"></div><svg width=\\"16\\" height=\\"16\\" viewBox=\\"0 0 24 24\\" class=\\"htw-relative htw-z-10\\"><path d=\\"m 4 12 l 5 5 l 10 -10\\" fill=\\"none\\" class=\\"htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out htw-transition-none\\" stroke-dasharray=\\"21.21\\" stroke-dashoffset=\\"21.21\\"></path></svg></div></span></span></label>"`;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, why dropping the two first exports?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To be honest I could not answer, I've just let vitest update the snapshots automatically haha
I just know that the snapshot format got improved in v1.0.0, removing the escaping characters.

@hugoattal hugoattal merged commit c98047e into histoire-dev:main Jan 7, 2026
15 of 16 checks passed
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