-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for checkForFunctionProperty so that order does not matter #6248
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6248 +/- ##
==========================================
- Coverage 67.56% 67.47% -0.10%
==========================================
Files 3379 3368 -11
Lines 65894 65431 -463
Branches 10660 10560 -100
==========================================
- Hits 44522 44147 -375
+ Misses 18774 18713 -61
+ Partials 2598 2571 -27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@ashwin-pc @joshuarrrr Could I get some reviews on this PR? |
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* Fix for checkForFunctionProperty so that order does not matter Signed-off-by: Craig Perkins <[email protected]> * Remove import for inspect Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * replace with jest.fn() Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Add scenarios where object does not contain fn Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> Co-authored-by: ZilongX <[email protected]> (cherry picked from commit b70c327) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
for (const value of Object.values(object)) { | ||
if (typeof value === 'function') { | ||
return true; | ||
} else if (Utils.isObject(value) && Utils.checkForFunctionProperty(value)) { | ||
return true; | ||
} | ||
} | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwperks could we refactory code a little
for (const value of Object.values(object)) {
if (typeof value === 'function') return true;
if (Utils.isObject(value) && Utils.checkForFunctionProperty(value)) return true;
}
return false;
#6384) * Fix for checkForFunctionProperty so that order does not matter * Remove import for inspect * replace with jest.fn() * Add scenarios where object does not contain fn --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> Co-authored-by: ZilongX <[email protected]> (cherry picked from commit b70c327) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Fixes an issue with the implementation of a utility function used in vis_type_vega plugin where order matters when determining if an object has a property that is a function. This PR adds test to assert the desired behavior in multiple scenarios.
Check List
yarn test:jest
yarn test:jest_integration