-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Hey folks,
I'm not sure if this is an issue for this library, react or even jest-dom, so I'm starting here so where it leads:
for the following component
const ClickThrowsComponent = () => {
const handleOnSectionClick = () => {
throw new Error('some error')
};
return (
<div data-testid='some-id'
onClick={handleOnSectionClick}
/>
);
};
the following test does not pass
test('should throw', () => {
const { getByTestId } = render(<ClickThrowsComponent />);
expect(()=>fireEvent.click(getByTestId('some-id'))).toThrow();
});
somehow the error is being swallowed on the way, I have tried almost all combinations with wrapping in act with async/awaits and promises to no avail
any help would be appreciated.
morzel85, moises-marquez, enzoferey, dwjohnston, AxeldeArias and 2 more
Metadata
Metadata
Assignees
Labels
No labels