Skip to content

Improve the custom auth unit tests #7871

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

Merged
merged 4 commits into from
Jul 2, 2025

Conversation

shenj
Copy link
Contributor

@shenj shenj commented Jun 27, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 18:42
@github-actions github-actions bot added the msal-browser Related to msal-browser package label Jun 27, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the custom auth unit tests by consolidating dependency mocks and standardizing test response data across various test files. Key changes include replacing inline mock implementations with shared test module functions (e.g. getDefaultLogger, getDefaultBrowserCacheManager) and updating hardcoded token response values with a centralized TestServerTokenResponse.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/msal-browser/test/custom_auth/test_resources/TestModules.ts New shared test modules for default dependencies.
lib/msal-browser/test/custom_auth/sign_up/* Refactored sign-up tests to use shared dependencies and standardized token responses.
lib/msal-browser/test/custom_auth/sign_in/* Updated sign-in tests replacing inline mocks and hardcoded values with shared utilities.
lib/msal-browser/test/custom_auth/reset_password/* Refactored reset password tests to use common test modules and token responses.
lib/msal-browser/test/custom_auth/integration_tests/* Updated integration tests to use TestServerTokenResponse and add cleanup steps after test execution.
lib/msal-browser/test/custom_auth/core/* Adjusted core test files to use shared dependencies and remove redundant mocks.

@konstantin-msft konstantin-msft force-pushed the native-auth/jiashen/unit-tests-improvements branch from 534dff4 to 9d595b9 Compare July 2, 2025 16:56
@konstantin-msft konstantin-msft merged commit 4744aa2 into dev Jul 2, 2025
7 checks passed
@konstantin-msft konstantin-msft deleted the native-auth/jiashen/unit-tests-improvements branch July 2, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-browser Related to msal-browser package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants