Skip to content

Releases: vitest-dev/vitest

v2.1.4

28 Oct 12:27
0df44c0
Compare
Choose a tag to compare

   🚀 Features

This patch release includes a non-breaking feature for the experimental Browser Mode that doesn't follow SemVer. If you want to avoid picking up releases like this, make sure to pin the Vitest version in your package.json. See npm's documentation about semver for more information.

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

v2.1.3

14 Oct 11:06
4c03a0d
Compare
Choose a tag to compare

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

v2.1.2

02 Oct 16:20
0ce26a4
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v2.1.1

13 Sep 15:33
699055e
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v2.1.0

12 Sep 14:04
9f1fd18
Compare
Choose a tag to compare

This release makes another big change to the Browser Mode by introducing locators API:

test('renders blog posts', async () => {
  const screen = page.render(<Blog />)

  await expect.element(screen.getByRole('heading', { name: 'Blog' })).toBeInTheDocument()

  const [firstPost] = screen.getByRole('listitem').all()

  await firstPost.getByRole('button', { name: 'Delete' }).click()

  expect(screen.getByRole('listitem').all()).toHaveLength(3)
})

You can use either vitest-browser-vue, vitest-browser-svelte or vitest-browser-react to render components and make assertions using locators. Locators are also available on the page object from @vitest/browser/context.

Potential Breaking Change

  • workspace:
    • Correctly resolve workspace globs and file paths  -  by @sheremet-va in #6316 (afdcb)
    • This changes how the custom glob pattern in the workspace config is treated. Any file matching the glob is considered a Vitest config file. Any folder matching the glob pattern is treated as a workspace project and is subject to the regular config resolution (single vitest.config.ts or vite.config.ts inside the folder)
    • For example, projects/* will match anything inside the projects folder. If it's a folder, we try to find the config inside that folder (if there is none, it is still treated as a project with the default config). If it's a file, it will be treated as a Vitest config. projects/**/* previously would assume that you only wanted to have folders as projects, but now it will match every single file insideprojects.
    • This change doesn't affect non-glob usage.

   🚀 Features

   🐞 Bug Fixes

Read more

v2.1.0-beta.7

09 Sep 15:13
b2be23e
Compare
Choose a tag to compare
v2.1.0-beta.7 Pre-release
Pre-release

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v2.1.0-beta.6

20 Aug 13:19
8ac7011
Compare
Choose a tag to compare
v2.1.0-beta.6 Pre-release
Pre-release

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v2.1.0-beta.5

12 Aug 11:48
72056b5
Compare
Choose a tag to compare
v2.1.0-beta.5 Pre-release
Pre-release

   🚀 Features

  • vitest: Add "provide" option  -  by @sheremet-va in #6253 (4409d)
  • browser: Recommend using vitest-browser-vue, vitest-browser-svelte or vitest-browser-react with built-in locators instead of @testing-library/framework packages (d79511)
    • Using built-in locators solves several issues we encountered after the Browser Mode rewrite in Vitest 2:
    • They support Shadow DOM unlike testing-library that relies solely on querySelector and closest
    • Having a single query mechanism between all frameworks and providers allows us to give users easy-to-understand examples which makes documenting it much easier
    • All locators have the retry-ability mechanism built-in when using .click/.fill and other userEvent methods
    • Locators use Playwright implementation which allows us to reuse established selectors from Playwright ecosystem

   🐞 Bug Fixes

    View changes on GitHub

v2.1.0-beta.4

07 Aug 11:43
67b086b
Compare
Choose a tag to compare
v2.1.0-beta.4 Pre-release
Pre-release

   🐞 Bug Fixes

  • browser: Keep querying elements even if locator is created with elementLocator, add pubic @vitest/browser/utils  -  by @sheremet-va in #6296 (30dc5)
    View changes on GitHub

v2.1.0-beta.3

07 Aug 08:17
73abf30
Compare
Choose a tag to compare
v2.1.0-beta.3 Pre-release
Pre-release

   🐞 Bug Fixes

    View changes on GitHub