Refactor Show-Advice Testing #298
Labels
Category-Tests ✅
Pertaining to tests for the module functions.
Good First Issue ❇️
Should be quick and easy!
Issue-Enhancement 🎉
Make it better!
Up For Grabs / Hacktoberfest 💻
If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it.
Describe "Functionality"
Currently the tests for
Show-Advice
's invalid koan errors interact with the file system in order to receive JSON that can't be used by the function and emit the expected errors.It should be possible to refactor these tests such that
Get-Content
is simplymock
ed to only return a valid JSON string that isn't a valid advice snippet, to avoid the interaction with the filesystem.Context "Private or Public? What are the use cases? Parameters? Options?"
Tests are located here: https://github.com/vexx32/PSKoans/blob/master/Tests/Functions/Public/Show-Advice.Tests.ps1
The text was updated successfully, but these errors were encountered: