feat(node-sdk): Improve feature overrides#437
Merged
Conversation
Contributor
roncohen
commented
Jun 25, 2025
- include a testing section
- rewrote many tests for Client because it was difficult to work with because of mocking and many asserts.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Node SDK’s feature override functionality by allowing direct object-based overrides, adding a clearFeatureOverrides method, refactoring tests for better clarity with flattenJSON, and documenting testing patterns.
- Extend
featureOverridessetter to accept plain objects and introduceclearFeatureOverrides. - Refactor client tests to use
flattenJSONand streamlined event filtering. - Add a “Testing” section in the README with usage examples.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/node-sdk/src/client.ts | Added object-based overrides support, clearFeatureOverrides, and adjusted mapping |
| packages/node-sdk/test/client.test.ts | Imported flattenJSON and simplified HTTP event assertions |
| packages/node-sdk/example/app.test.ts | Updated example tests to use object override syntax |
| packages/node-sdk/README.md | Added “Testing” section with feature override examples |
Comments suppressed due to low confidence (1)
packages/node-sdk/README.md:430
- The example uses
bucket.setFeatureOverridebut the setter is namedfeatureOverrides. It should readbucket.featureOverrides = { ... }.
bucket.setFeatureOverride = {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t-javascript-sdk into improve-feature-overrides
pavkam
approved these changes
Jun 25, 2025
laander
reviewed
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.