Skip to content

Conversation

@jeremymeng
Copy link
Member

No description provided.

Copy link
Contributor

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 updates test assertions across the Azure Identity SDK test suite to use more specific and semantically appropriate assertion methods from the testing framework. The changes improve test readability and precision by replacing generic assert.ok() calls with more descriptive alternatives like assert.isDefined() and assert.isTrue().

Key Changes

  • Replaces assert.ok(value) with assert.isDefined(value) for existence checks on tokens, errors, and accounts
  • Replaces assert.ok(condition) with assert.isTrue(condition) for boolean expression validations (timestamp comparisons, string matches)
  • Applies these improvements consistently across all credential test files in the identity, identity-vscode, and identity-cache-persistence packages

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/identity/identity/test/public/node/workloadIdentityCredential.spec.ts Updates token validation assertions for WorkloadIdentityCredential, ManagedIdentityCredential, and DefaultAzureCredential tests
sdk/identity/identity/test/public/node/usernamePasswordCredential.spec.ts Updates token and error message validation assertions
sdk/identity/identity/test/public/node/environmentCredential.spec.ts Updates assertions for client secret, certificate, and username/password authentication tests
sdk/identity/identity/test/public/node/deviceCodeCredential.spec.ts Updates token and account validation assertions, including abort error message checks
sdk/identity/identity/test/public/node/clientSecretCredential.spec.ts Updates assertions for authentication and CAE-enabled token tests
sdk/identity/identity/test/public/node/clientCertificateCredential.spec.ts Updates token validation and error message assertions
sdk/identity/identity/test/public/node/azurePipelinesCredential.spec.ts Updates token and timestamp validation assertions
sdk/identity/identity/test/public/node/authorityValidation.spec.ts Updates token validation assertions for authority validation tests
sdk/identity/identity/test/internal/node/workloadIdentityCredential.spec.ts Updates validation helper function and credential test assertions
sdk/identity/identity/test/internal/node/usernamePasswordCredential.spec.ts Updates token validation for authenticated account logging test
sdk/identity/identity/test/internal/node/clientSecretCredential.spec.ts Updates token validation for authenticated account logging test
sdk/identity/identity/test/internal/node/clientCertificateCredential.spec.ts Updates error existence assertions for certificate validation tests
sdk/identity/identity/test/internal/node/caeARM.spec.ts Updates token validation assertions for CAE challenge flow tests
sdk/identity/identity/test/internal/node/azurePowerShellCredential.spec.ts Updates error and token validation assertions, including timestamp checks
sdk/identity/identity/test/internal/node/azureDeveloperCliCredential.spec.ts Updates command validation assertion for --no-prompt flag check
sdk/identity/identity/test/internal/node/azureCliCredential.spec.ts Updates error existence assertions for CLI credential tests
sdk/identity/identity-vscode/test/public/node/visualStudioCodeCredential.spec.ts Updates token and timestamp validation assertions
sdk/identity/identity-cache-persistence/test/internal/node/usernamePasswordCredential.spec.ts Updates cache token existence assertions
sdk/identity/identity-cache-persistence/test/internal/node/deviceCodeCredential.spec.ts Updates cache token, account, and token validation assertions
sdk/identity/identity-cache-persistence/test/internal/node/clientSecretCredential.spec.ts Updates cache token existence assertion
sdk/identity/identity-cache-persistence/test/internal/node/clientCertificateCredential.spec.ts Updates cache token existence assertion

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure Identity SDK Improvements Nov 11, 2025
@jeremymeng
Copy link
Member Author

Thanks for the review!

@jeremymeng jeremymeng merged commit 624b4c8 into Azure:main Nov 11, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure Identity SDK Improvements Nov 11, 2025
@jeremymeng jeremymeng deleted the test/identity-replace-assert-ok branch November 11, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants