Skip to content
/ vijest Public

A Jest test runner for modern single-page web apps built with Vite

License

Notifications You must be signed in to change notification settings

taye/vijest

Repository files navigation

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

About

A Jest test runner for modern single-page web apps built with Vite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages