TestDrive
noun
say it: “TEST dryve” /ˈtɛst draɪv/
An empty scratch folder Pester makes for a group of tests and deletes afterwards, so tests can write files safely.
What is TestDrive in Pester?
TestDrive: is a scratch folder Pester makes, empty, for each Describe block and deletes when the block ends. A test can write playlists and reports there without touching your real files.
$csv = Join-Path $TestDrive 'test.csv'
Set-Content $csv 'Title,Artist,Length', 'Golden Hour Drive,The Night Owls,3:45'
(Get-Song -Path $csv).Count | Should -Be 1
In a sentence
- “The test writes its pretend playlist into TestDrive.”
- “Nothing in TestDrive is left behind after the tests finish.”
Level: Freelancer · More PowerShell terms at this level
Updated