Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Show-Advice Testing #298

Closed
vexx32 opened this issue Oct 23, 2019 · 0 comments · Fixed by #361
Closed

Refactor Show-Advice Testing #298

vexx32 opened this issue Oct 23, 2019 · 0 comments · Fixed by #361
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.

Comments

@vexx32
Copy link
Owner

vexx32 commented Oct 23, 2019

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 simply mocked 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

@vexx32 vexx32 added 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. Good First Issue ❇️ Should be quick and easy! Category-Tests ✅ Pertaining to tests for the module functions. Hacktoberfest labels Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant