Skip to content

Commit a9d5dbe

Browse files
Microsoft Graph DevX ToolingFehintolaObafemi
Microsoft Graph DevX Tooling
authored andcommitted
Fixed pester test expected messages
1 parent e0cd390 commit a9d5dbe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Authentication/Authentication/test/Connect-MgGraph.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ Describe 'Connect-MgGraph In Delegated Mode' {
7373

7474
Describe 'Connect-MgGraph In Environment Variable Mode' {
7575
It 'Should throw exception when supported environment variables are not specified' {
76-
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*EnvironmentCredential authentication unavailable. Environment variables are not fully configured*"
76+
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed*"
7777
}
7878
It 'Should attempt to use configured environment variables' {
7979
{
8080
$Env:AZURE_CLIENT_ID = "Not_Valid"
8181
$Env:AZURE_CLIENT_SECRET = "Not_Valid"
8282
$Env:AZURE_TENANT_ID = "common"
8383
Connect-MgGraph -EnvironmentVariable -ErrorAction Stop
84-
} | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed: AADSTS700016: Application with identifier 'Not_Valid' was not found in the directory 'Microsoft'.*"
84+
} | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed*"
8585
}
8686
}
8787

@@ -99,7 +99,7 @@ Describe 'Connect-MgGraph In App Mode' {
9999
Describe 'Connect-MgGraph Dependency Resolution' {
100100
It 'Should load Mg module side by side with Az module.' {
101101
{ Connect-AzAccount -ApplicationId $RandomClientId -CertificateThumbprint "Invalid" -Tenant "Invalid" -ErrorAction Stop } | Should -Throw -ExpectedMessage "*Could not find tenant id*"
102-
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "*AADSTS90002*"
102+
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "*DeviceCodeCredential authentication failed*"
103103
}
104104
}
105105

0 commit comments

Comments
 (0)