MyGit

v2.1.0

vitest-dev/vitest

版本发布时间: 2024-09-12 22:04:00

vitest-dev/vitest最新发布版本:v3.0.0-beta.2(2024-12-10 18:22:19)

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

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-09-12发行的版本