Preact: Support react-test-renderer

Created on 12 Apr 2020  路  3Comments  路  Source: preactjs/preact

Continuing this issue from preact-compat repo.

Currently, some testing utilities libraries rely on react-test-renderer, for example @testing-library/react-hooks. This library is used to test React hooks in a React application. Having an equivalent of react-test-renderer would help in migrating an existing React app to Preact.

feature request feedback needed has fix

Most helpful comment

Hello!

We had the same issue as well. So we ported the official @testing-library/react-hooks package :D

https://github.com/trivago/preact-hooks-testing-library

Would love some feedback as well. It should be _mostly_ at feature parity with the react hooks version, but that isn't 100% guaranteed.

All 3 comments

I had the same issue for testing hooks so I ported this library https://github.com/andrew-w-ross/test-react-hooks to preact. You can find it here https://www.npmjs.com/package/test-preact-hooks

It's still very much alpha and might break like glass so please use at your own risk and leave an issue report if you run into problems.

Hello!

We had the same issue as well. So we ported the official @testing-library/react-hooks package :D

https://github.com/trivago/preact-hooks-testing-library

Would love some feedback as well. It should be _mostly_ at feature parity with the react hooks version, but that isn't 100% guaranteed.

I wonder if we can close this issue out now that @testing-library/preact-hooks exists?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zashy picture Zashy  路  3Comments

adriaanwm picture adriaanwm  路  3Comments

kossnocorp picture kossnocorp  路  3Comments

skaraman picture skaraman  路  3Comments

k15a picture k15a  路  3Comments