chore: init @launchdarkly/client-testing-plugin#1373
Conversation
|
@cursor review |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@cursor review |
|
@cursor review |
df6d8ed to
637feac
Compare
|
@cursor review |
|
@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 b9eed76. Configure here.
| }; | ||
| } | ||
|
|
||
| describe('TestData', () => { |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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 aTestDataplugin 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,tsconfigreferences, 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.gitignorenow ignores.claude/stacks/.Reviewed by Cursor Bugbot for commit b9eed76. Bugbot is set up for automated code reviews on this repo. Configure here.