Describe the Feature
toJSON helper would be handy when taking snapshots of components through queries.
We are trying to migrate to v7 from native-testing-library. We don't like relying on snapshots but we do sometimes get aimed snapshots on specific components. At the moment, it causes a circular problem if trying to assert a snapshot on a component, eg:
expect(getByTestId('testID')).toMatchSnapshot();
We use to be able to do this but I guess with NTL we weren't consuming the ReactTestInstance directly so probably the problem was mitigated.
Possible Implementations
https://github.com/testing-library/native-testing-library/blob/a8ba4166942072ee420e2c77b7e377a605481e6b/src/lib/to-json.js
Is it possible to recycle the code from native-testing-library? I don't mind creating a PR but I do not know if we can recycle the code and if the helper is appropriate.
Describe the Feature
toJSONhelper would be handy when taking snapshots of components through queries.We are trying to migrate to v7 from native-testing-library. We don't like relying on snapshots but we do sometimes get aimed snapshots on specific components. At the moment, it causes a circular problem if trying to assert a snapshot on a component, eg:
We use to be able to do this but I guess with NTL we weren't consuming the
ReactTestInstancedirectly so probably the problem was mitigated.Possible Implementations
https://github.com/testing-library/native-testing-library/blob/a8ba4166942072ee420e2c77b7e377a605481e6b/src/lib/to-json.js
Is it possible to recycle the code from native-testing-library? I don't mind creating a PR but I do not know if we can recycle the code and if the helper is appropriate.