launchdarkly / jest-launchdarkly-mock

Easily unit test LaunchDarkly feature flagged components with jest
Apache License 2.0
25 stars 18 forks source link

WithLDConsumer returns null #28

Closed debaraj-barua closed 2 years ago

debaraj-barua commented 2 years ago

From my perspective, WithLDConsumer should not return null while mocking, it should return the children instead.

https://github.com/launchdarkly/jest-launchdarkly-mock/blob/d3e792082b4e3743cff63c331e92341a82ed1574/src/index.ts#L55

This leads to errors like image when mocking

carmenquan commented 2 years ago

@debaraj-barua thanks for opening the PR - our team will look at it soon.