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

test(sdk): Allow any MockEndpoint to override the expected access token #4773

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Mar 9, 2025

Generalizes the behavior introduced in #4767 for the /whoami mock endpoint.

It requires creators of MockEndpoints to use the built-in methods instead of custom methods on MockBuilder and sadly there is no way to enforce this programmatically.

Instead of MockBuilder::respond_with. This reduces duplcation and will
allow to add some common logic when building the endpoints.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner March 9, 2025 11:16
@zecakeh zecakeh requested review from poljar and removed request for a team March 9, 2025 11:16
zecakeh added 2 commits March 9, 2025 12:19
Allows to reduce duplication and will allow to add common logic.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh force-pushed the mock-access-token branch from adfc612 to 1dbc239 Compare March 9, 2025 11:19
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

Attention: Patch coverage is 92.42424% with 10 lines in your changes missing coverage. Please review.

Project coverage is 86.31%. Comparing base (48767da) to head (1dbc239).

Files with missing lines Patch % Lines
crates/matrix-sdk/src/test_utils/mocks/mod.rs 91.15% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4773      +/-   ##
==========================================
- Coverage   86.35%   86.31%   -0.05%     
==========================================
  Files         291      291              
  Lines       34326    34266      -60     
==========================================
- Hits        29643    29577      -66     
- Misses       4683     4689       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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