0.0.2 • Published 5 months ago

vijest v0.0.2

Weekly downloads
-
License
Parity-7.0.0
Repository
github
Last release
5 months ago

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