Post

Thanks to the great feedback, I started playing around with a custom element providing these public methods to be used for unit testing. I wrote them to be as similar to `@testing-library/user-event` as possible. Instead of await userEvent.type(input, 'hello'); you write await input.type('hello')

Rogin Farrer@rogin.dev

Web component library maintainers, how do you intend for your users to write tests in React with your components? It feels like shadow roots pose a big challenge. I’m wondering if we might need to develop some kind of test harness to abstract the shadow DOM away.

0 reposts1 like

No replies yet.