Summary of the new feature / enhancement
It looks like aliases were removed from the Pester test scripts in #8546 in an automated fashion, which is generally a good hygienic step (and suppresses complaints from linters), except that some of these tests were checking for the presence and behaviour of aliases themselves.
For example, one test in GroupObject.Tests.ps1 begins -
It "Should have the same output between the group alias and the group-object cmdlet" {
$actualAlias = Group-Object -InputObject $testObject
$actualCmdlet = Group-Object -InputObject $testObject
And then goes on to compare the results - but it's no longer doing a meaningful comparison.
Proposed technical implementation details (optional)
It makes some sense for the test to check for default aliases - it's effectively enforcing the 'default interface' to a given utility.
However, if Aliases are known to work correctly after build, i.e. by checking that functionality elsewhere, we probably don't need to check the actual behaviour.
In that case, the test suite could just check for the presence of the alias, e.g.
It "should have the Group alias" {
$aliasCommand = (Get-Alias Group).ResolvedCommand
$actualCommand = (Get-Command Group-Object)
$aliasCommand | Should -Be $actualCommand
}
Summary of the new feature / enhancement
It looks like aliases were removed from the Pester test scripts in #8546 in an automated fashion, which is generally a good hygienic step (and suppresses complaints from linters), except that some of these tests were checking for the presence and behaviour of aliases themselves.
For example, one test in GroupObject.Tests.ps1 begins -
And then goes on to compare the results - but it's no longer doing a meaningful comparison.
Proposed technical implementation details (optional)
It makes some sense for the test to check for default aliases - it's effectively enforcing the 'default interface' to a given utility.
However, if Aliases are known to work correctly after build, i.e. by checking that functionality elsewhere, we probably don't need to check the actual behaviour.
In that case, the test suite could just check for the presence of the alias, e.g.