Created
May 31, 2023 21:58
-
-
Save sbin0819/e6329a891727dddc56f87d2ff2f4a05a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```ts | |
import { render as renderComponent } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
export const render = ( | |
ui: React.ReactElement, | |
options?: Parameters<typeof renderComponent>[1], | |
) => { | |
const user = userEvent.setup(); | |
const result = renderComponent(ui, options); | |
return { | |
...result, | |
user, | |
}; | |
}; | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment