-
-
Notifications
You must be signed in to change notification settings - Fork 188
Refactor Show-Advice Testing #298
Copy link
Copy link
Closed
Labels
Category-Tests ✅Pertaining to tests for the module functions.Pertaining to tests for the module functions.Good First Issue ❇️Should be quick and easy!Should be quick and easy!Issue-Enhancement 🎉Make it better!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.If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it.
Description
Activity
Metadata
Metadata
Assignees
Labels
Category-Tests ✅Pertaining to tests for the module functions.Pertaining to tests for the module functions.Good First Issue ❇️Should be quick and easy!Should be quick and easy!Issue-Enhancement 🎉Make it better!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.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-Contentis simplymocked 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