@hypoth-ui/test-utils
v1.0.2
Published
Test utilities for the hypoth-ui design system
Downloads
592
Maintainers
Readme
@hypoth-ui/test-utils
Shared test utilities for the hypoth-ui design system. Provides helpers for rendering, querying, and asserting on Web Components and React adapters in Vitest.
Installation
npm install @hypoth-ui/test-utils --save-devUsage
import { renderWc, renderReact, waitForElement } from '@hypoth-ui/test-utils';
// Render a Web Component for testing
const el = await renderWc('<ds-button variant="primary">Click</ds-button>');
// Render a React adapter for testing
const { getByRole } = renderReact(<Button variant="primary">Click</Button>);
// Wait for a custom element to be defined
await waitForElement('ds-button');Documentation
See the main README for full documentation and architecture overview.
License
MIT
