jest-launchdarkly-mock icon indicating copy to clipboard operation
jest-launchdarkly-mock copied to clipboard

add support for mocking launchdarkly-js-client-sdk

Open blimmer opened this issue 4 years ago • 6 comments

right now, this package only works if you're using the react SDK: https://github.com/launchdarkly-labs/jest-launchdarkly-mock/blob/4a9f50510c6057f43a54cb1677f99f1b0fe402bf/src/index.ts#L1

I'm using vue and it would be great to be able to use this helper

blimmer avatar Oct 25 '21 21:10 blimmer

This would be good to see, or have a note on the README stating that this is only for the react SDK

ghost avatar Oct 28 '21 13:10 ghost

Any updates? Still facing this issue.

cameron-hicks avatar Feb 01 '22 17:02 cameron-hicks

Thank you for submitting this issue. We are considering supporting both the js sdk and the node sdk with this package but we don't have a timeline right now. I'll keep this issue open and will post an update when there's one.

yusinto avatar Feb 09 '22 20:02 yusinto

I've written something that can be used to mock LD when using js-sdk. I'm using this approach in my tests, and it seems to work fine.

@yusinto please take a look when you can; maybe you can reuse what I did to speed up the release of the official js-sdk mock for LD. :)

https://gist.github.com/darktasevski/9e441edf17d2f91898d10d2c58d8d5f9

Edit: updated the gist URL, ty for catching the issue @megustalafantabienfria

darktasevski avatar Oct 04 '22 15:10 darktasevski

I've written something that can be used to mock LD when using js-sdk. I'm using this approach in my tests, and it seems to work fine.

@yusinto please take a look when you can; maybe you can reuse what I did to speed up the release of the official js-sdk mock for LD. :)

https://gist.github.com/d-tasevski/9e441edf17d2f91898d10d2c58d8d5f9

I get a 404 when I try to open your gist :( can you share it again? pls

EDIT: Thanks! It worked for what I was trying to test :)

a-vizuet avatar Nov 01 '22 08:11 a-vizuet