Skip to content

chore: adding predefined sdk wrappers for test data#1413

Merged
joker23 merged 1 commit into
mainfrom
skz/sdk-1997/client-test-data-clients
Jun 5, 2026
Merged

chore: adding predefined sdk wrappers for test data#1413
joker23 merged 1 commit into
mainfrom
skz/sdk-1997/client-test-data-clients

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented Jun 3, 2026

This PR will create test data wrappers for js-client-sdk and react-sdk to make the tooling more ergonomic.

This PR will also pull in the eslint upgrade.

NOTE: we did not wrap the react-native-sdk test 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-sdk and @launchdarkly/react-sdk via new subpath exports @launchdarkly/client-testing-plugin/js-client-sdk and .../react-sdk.

Each createTestClient builds a client with TestData appended after any user plugins, plus sendEvents: false and streaming: false, and returns { client, testData } so tests can seed initialFlags and mutate flags at runtime. The React entry also exposes createTestClientProvider, which pairs the same client with a pre-wired Provider from createLDReactProviderWithClient.

Build and packaging: tsup now 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.

@joker23 joker23 force-pushed the skz/sdk-1997/client-test-data-clients branch from 60c4f76 to 093376c Compare June 3, 2026 20:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38739 bytes
Compressed size limit: 39000
Uncompressed size: 212244 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31979 bytes
Compressed size limit: 34000
Uncompressed size: 114243 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179654 bytes
Compressed size limit: 200000
Uncompressed size: 831422 bytes

NOTE: we removed the `react-native-sdk` test data wrapper because it is
not effective.
@joker23 joker23 force-pushed the skz/sdk-1997/client-test-data-clients branch from 093376c to c790a1a Compare June 3, 2026 21:37
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Jun 3, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@Dobby89
Copy link
Copy Markdown

Dobby89 commented Jun 4, 2026

Please merge this. We can't easily mock LD when using the new @launchdarkly/react-sdk package until this is released.

@joker23 joker23 marked this pull request as ready for review June 4, 2026 13:24
@joker23 joker23 requested a review from a team as a code owner June 4, 2026 13:24
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@joker23 joker23 merged commit 014b59b into main Jun 5, 2026
49 checks passed
@joker23 joker23 deleted the skz/sdk-1997/client-test-data-clients branch June 5, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants