vijest
v0.0.2
Published
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.
Downloads
57
Readme
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', '[email protected]')
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