launchdarkly / jest-launchdarkly-mock

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

Fixing mocked asyncWithLDProvider to return Promise #20

Closed SHND closed 2 years ago

SHND commented 2 years ago

Requirements

Related issues

https://github.com/launchdarkly/jest-launchdarkly-mock/issues/16

Describe the solution you've provided

This is a fix for mockAsyncWithLDProvider. From the docs asyncWithLDProvider should return a Promise. This promise should resolved to a React component. This resolved React component on the good path, should render the children that are passed to it through its props.

Describe alternatives you've considered

Additional context

yusinto commented 2 years ago

Thank you @SHND I'll make sure this gets included in the next release.