Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek authored and azure-sdk committed Sep 23, 2024
1 parent bc3801f commit 811ff6a
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions eng/common/spelling/Invoke-Cspell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ If set the PackageInstallCache will not be deleted. Use if there are multiple
calls to Invoke-Cspell.ps1 to prevent creating multiple working directories and
redundant calls `npm ci`.
.PARAMETER Test
Run test functions against the script logic
.EXAMPLE
./eng/common/scripts/Invoke-Cspell.ps1 -ScanGlobs 'sdk/*/*/PublicAPI/**/*.md'
Expand Down Expand Up @@ -64,10 +61,7 @@ param(
[string] $PackageInstallCache = (Join-Path ([System.IO.Path]::GetTempPath()) "cspell-tool-path"),

[Parameter()]
[switch] $LeavePackageInstallCache,

[Parameter()]
[switch] $Test
[switch] $LeavePackageInstallCache
)

Set-StrictMode -Version 3.0
Expand All @@ -82,30 +76,6 @@ if (!(Test-Path $CSpellConfigPath)) {
exit 1
}

function Test-VersionReportMatches() {
# Arrange
$expectedPackageVersion = '6.12.0'

# Act
$actual = &"$PSScriptRoot/Invoke-Cspell.ps1" `
-JobType '--version'

# Assert
if ($actual -ne $expectedPackageVersion) {
throw "Mismatched version. Expected:`n$expectedPackageVersion`n`nActual:`n$actual"
}
}

function TestInvokeCspell() {
Test-VersionReportMatches
}

if ($Test) {
TestInvokeCspell
Write-Host "Test complete"
exit 0
}

# Prepare the working directory if it does not already have requirements in
# place.
if (!(Test-Path $PackageInstallCache)) {
Expand Down

0 comments on commit 811ff6a

Please sign in to comment.