chore: adding predefined sdk wrappers for test data#1413
Conversation
60c4f76 to
093376c
Compare
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
NOTE: we removed the `react-native-sdk` test data wrapper because it is not effective.
093376c to
c790a1a
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c790a1a. Configure here.
|
Please merge this. We can't easily mock LD when using the new @launchdarkly/react-sdk package until this is released. |
This PR will create test data wrappers for
js-client-sdkandreact-sdkto make the tooling more ergonomic.This PR will also pull in the eslint upgrade.
NOTE: we did not wrap the
react-native-sdktest data wrapper because unit testing react native in this way requires a much more robust setup that we are not pursuing yet.Note
Low Risk
Test-only tooling and package exports with no production SDK behavior changes; ESLint upgrade is confined to this package.
Overview
Adds ergonomic offline test helpers for
@launchdarkly/js-client-sdkand@launchdarkly/react-sdkvia new subpath exports@launchdarkly/client-testing-plugin/js-client-sdkand.../react-sdk.Each
createTestClientbuilds a client withTestDataappended after any userplugins, plussendEvents: falseandstreaming: false, and returns{ client, testData }so tests can seedinitialFlagsand mutate flags at runtime. The React entry also exposescreateTestClientProvider, which pairs the same client with a pre-wired Provider fromcreateLDReactProviderWithClient.Build and packaging:
tsupnow emits the two client modules; optional peer dependencies on the JS and React SDKs were added so consumers import only what they need. Jest coverage verifies seeding, plugin composition, dynamic overrides, and the React Provider helper. Lint tooling in this package was bumped to ESLint 9 with updated scripts.Reviewed by Cursor Bugbot for commit c790a1a. Bugbot is set up for automated code reviews on this repo. Configure here.