Open gorgias-botond-dombi opened 2 years ago
Thanks @gorgias-botond-dombi for reporting this issue. I'll follow up with our team and get back to you!
Hi @carmenquan , apologies for following up on this old thread. Do you have any updates on this? Thanks!
Hi @gorgias-botond-dombi , have you found any workarounds or solutions to this issue? Thanks!
Is your feature request related to a problem? Please describe. The flags will never be mocked when using withLDConsumer for a class component. It will only be mocked for the hook useFlags. https://github.com/launchdarkly/jest-launchdarkly-mock/blob/e509cc7febb427a6f2576a20d8fde3be3a045f6a/src/index.ts#L55 vs https://github.com/launchdarkly/jest-launchdarkly-mock/blob/e509cc7febb427a6f2576a20d8fde3be3a045f6a/src/index.ts#L58-L72 Describe the solution you'd like The withLDConsumer should be passing the mocked flags object as a prop, to the rendered component.