Skip to content

Commit

Permalink
Mock Get-ChildItem in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adhilto committed Nov 13, 2024
1 parent 3e3e131 commit efe0ea8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ InModuleScope Orchestrator {
Mock -CommandName Get-FileEncoding
Mock -CommandName ConvertTo-Csv { "" }
Mock -CommandName Write-Warning {}
Mock -CommandName Get-ChildItem { @{"FullName"="ScubaResults.json"; "CreationTime"=$(Get-Date)} }
}

It 'Handles multiple products, control groups, and controls' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ InModuleScope Orchestrator {
Mock -CommandName Get-Content {}
Mock -CommandName Get-Member { $true }
Mock -CommandName New-Guid { "00000000-0000-0000-0000-000000000000" }
Mock -CommandName Get-ChildItem { @{"FullName"="ScubaResults.json"; "CreationTime"=$(Get-Date)} }
}
Context 'When checking the conformance of commercial tenants' {
BeforeAll {
Expand Down

0 comments on commit efe0ea8

Please sign in to comment.