vijest
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Vijest

A Jest test runner for modern single-page web apps built with Vite. Run your tests directly in a headless browser with a straight forward async API.

npm install --save-dev vijest jest
// jest.config.json
{
  "preset": "vijest"
}
// login.spec.ts
import '@testing-library/jest-dom'

test('login', async () => {
  getByTestId('login-button').click()

  expect(getByTestId('login-submit')).toBeDisabled()

  await vt.type('#username-input', 'test@example.com')
  await vt.type('#password-input', 'test-password')

  vt.debugger()

  findByTestId('login-button').click()

  await waitFor(() => expect(location.pathname).toBe('/dashboard'))
})
# start tests with jest cli
npx jest

Readme

Keywords

none

Package Sidebar

Install

npm i vijest

Weekly Downloads

9

Version

0.0.2

License

Parity-7.0.0

Unpacked Size

888 kB

Total Files

34

Last publish

Collaborators

  • taye