test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

feat(deps)!: upgrade to vitest v4

Open danielroe opened this issue 2 months ago โ€ข 2 comments

๐Ÿ”— Linked issue

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation or readme)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [ ] ๐Ÿ‘Œ Enhancement (improving an existing functionality)
  • [ ] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

this updates us to vitest v4 and drops support for previous versions of vitest.

there's still an issue with starting vitest programmatically (in the nuxt devtools) but it's unclear to me if this is a nuxt/test-utils bug or a vitest one

danielroe avatar Nov 03 '25 12:11 danielroe

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1481

commit: 2143883

pkg-pr-new[bot] avatar Nov 03 '25 12:11 pkg-pr-new[bot]

There is a problem with runtime config:

  runtimeConfig: {
    public: {
      whatever: {
        hello: 'world',
      },
    },
  },

  it('renders', () => {
    const config = useRuntimeConfig()
    console.log('public', config.public)
  })
public {}

Reproduction: https://github.com/OrbisK/test-utils-fork/tree/feat/vitest-4-reprod-runtimeconfig

OrbisK avatar Nov 03 '25 13:11 OrbisK