Skip to content

Commit 6074b1f

Browse files
Microsoft Graph DevX ToolingFehintolaObafemi
Microsoft Graph DevX Tooling
authored andcommitted
Fixed pester test expected messages
1 parent 4f01aba commit 6074b1f

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
@@ -69,15 +69,15 @@ Describe 'Connect-MgGraph In Delegated Mode' {
6969

7070
Describe 'Connect-MgGraph In Environment Variable Mode' {
7171
It 'Should throw exception when supported environment variables are not specified' {
72-
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*EnvironmentCredential authentication unavailable. Environment variables are not fully configured*"
72+
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed*"
7373
}
7474
It 'Should attempt to use configured environment variables' {
7575
{
7676
$Env:AZURE_CLIENT_ID = "Not_Valid"
7777
$Env:AZURE_CLIENT_SECRET = "Not_Valid"
7878
$Env:AZURE_TENANT_ID = "common"
7979
Connect-MgGraph -EnvironmentVariable -ErrorAction Stop
80-
} | Should -Throw -ExpectedMessage "ClientSecretCredential authentication failed: "
80+
} | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed*"
8181
}
8282
}
8383

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

0 commit comments

Comments
 (0)