launchdarkly / jest-launchdarkly-mock

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

Error AsyncWithLDPRovider is not a function #16

Closed SHND closed 2 years ago

SHND commented 2 years ago

I'm trying to mock the LaunchDarkly React SDK using this package. I'm using AsyncWithLDPRovider, but when I'm running my jest with react-library-testing I'm getting:

Error (0, _launchdarklyReactClientSdk.asyncWithLDProvider) is not a function

I believe this is fixed in https://github.com/launchdarkly-labs/jest-launchdarkly-mock/pull/15, but still don't see this in the latest npm package.

yusinto commented 2 years ago

We have an upcoming release that includes this fix. I'll update this issue when that's done. Thank you.

SHND commented 2 years ago

From the PR above, it seems that it is not the correct fix. I put a comment on the PR. I think AsyncWithLDProvide mock should return promise.

danielwitz commented 2 years ago

Hey, I still have this issue. I think that even tho this was merged, a new version wasn't released. When is the next release due?

yusinto commented 2 years ago

Thank you for your patience. This is now fixed in v1.0.0.