Skip to content

chore: init @launchdarkly/client-testing-plugin#1373

Open
joker23 wants to merge 2 commits into
mainfrom
skz/sdk-1997/client-test-data-plugin
Open

chore: init @launchdarkly/client-testing-plugin#1373
joker23 wants to merge 2 commits into
mainfrom
skz/sdk-1997/client-test-data-plugin

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented May 8, 2026

This PR pushes the initial implementation of the client test data plugin

SDK-2124


Note

Medium Risk
Introduces a new publishable workspace package that hooks into the SDK debug-override path; risk is mainly around correctness/compatibility of the plugin interface and its interaction with client initialization and change events.

Overview
Adds a new workspace package, @launchdarkly/client-testing-plugin, providing a TestData plugin that injects and dynamically updates client-side flag values via the SDK’s debug-override mechanism (including typed setters, remove, clear, and primitive-update deduping).

Includes package build/test tooling (tsup, tsconfig references, Jest + jsdom setup) plus unit and browser e2e tests validating real SDK integration and change event behavior. Repo wiring is updated to include the workspace and TS project reference, and .gitignore now ignores .claude/stacks/.

Reviewed by Cursor Bugbot for commit b9eed76. Bugbot is set up for automated code reviews on this repo. Configure here.

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 8, 2026

@cursor review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 8, 2026

@cursor review

@joker23 joker23 force-pushed the skz/sdk-1997/client-test-data-plugin branch from df6d8ed to 637feac Compare May 8, 2026 16:18
@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 8, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 8, 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 b9eed76. Configure here.

@joker23 joker23 marked this pull request as ready for review May 8, 2026 16:58
@joker23 joker23 requested a review from a team as a code owner May 8, 2026 16:58
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 found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

};
}

describe('TestData', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 describe block used without shared configuration, violating testing guidelines

The describe('TestData', ...) block in TestData.test.ts wraps all tests but has no shared setup — no beforeEach, no afterEach, no shared let variables. Every test creates its own TestData instance and mock independently.

CLAUDE.md and .cursor/rules/testing.mdc both explicitly state: "Describe blocks should ONLY be used for common setup for a series of tests" and "If there is no shared configuration, do not use a describe block." The existing analogous test file at packages/shared/sdk-client/__tests__/plugins/safeRegisterDebugOverridePlugins.test.ts correctly uses top-level it(...) blocks without a wrapping describe.

Prompt for agents
Remove the wrapping describe('TestData', () => { ... }) block from TestData.test.ts since there is no shared configuration (no beforeEach, afterEach, or shared variables). All it(...) test cases should be promoted to the top level of the file, and the closing }); of the describe block at the end of the file should be removed. This matches the pattern used in packages/shared/sdk-client/__tests__/plugins/safeRegisterDebugOverridePlugins.test.ts which has similar standalone tests without a describe wrapper.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant