Skip to content
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: makeApiContextWrapper and createMockProxy #1312

Merged
merged 6 commits into from
May 23, 2023

Conversation

bmingles
Copy link
Contributor

  • makeApiContextWrapper - wrapped in forwardRef to remove console.errr
  • createMockProxy - now prints object properties instead of undefined in jest matchers. Proxied mock methods now include a mockName() call to give clearer output

fixes #1311

@bmingles bmingles requested a review from vbabich May 18, 2023 21:36
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #1312 (a1b2bbb) into main (9212107) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1312   +/-   ##
=======================================
  Coverage   45.95%   45.95%           
=======================================
  Files         492      493    +1     
  Lines       34374    34404   +30     
  Branches     8567     8580   +13     
=======================================
+ Hits        15795    15811   +16     
- Misses      18528    18542   +14     
  Partials       51       51           
Flag Coverage Δ
unit 45.95% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/utils/src/MockProxy.ts 100.00% <100.00%> (ø)
packages/utils/src/TestUtils.ts 92.85% <100.00%> (-0.99%) ⬇️

... and 13 files with indirect coverage changes

@bmingles bmingles requested a review from mofojed May 23, 2023 14:04
}: {
children?: ReactNode;
},
_ref
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder what's the root cause of the issue? Why does renderHook require the ref? _ref argument isn't even passed anywhere, could this be a bug in renderHook itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suspect it uses it internally for something but not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm, I was wrong. Real cause of the original issue is that ref needs to be excluded from the auto proxy

@bmingles bmingles requested a review from vbabich May 23, 2023 16:59
@bmingles bmingles merged commit d389963 into deephaven:main May 23, 2023
@bmingles bmingles deleted the 1311-test-utils-fixes branch May 23, 2023 17:15
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestUtils - makeApiContextWrapper console error and mock proxy improvements
2 participants