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

(#298) Refactor Show-Advice Tests #361

Merged
merged 1 commit into from
Feb 27, 2020
Merged

Conversation

vexx32
Copy link
Owner

@vexx32 vexx32 commented Feb 27, 2020

PR Summary

Use mocks instead of modifying the filesystem & use test cases instead of manual for loops.

Context

Resolves #298

Changes

  • Move malformed JSON tests to a new Context
  • Mock Get-Content and Get-ChildItem so that we can just return the JSON without editing files on the hard drive
  • Use TestCases to go through the different variants of invalid json rather than a for loop.

Checklist

  • Pull Request has a meaningful title.
  • Summarised changes.
  • Pull Request is ready to merge & is not WIP.
  • Added tests / only testable interactively.
    • Make sure you add a new test if old tests do not effectively test the code changed.
  • Added documentation / opened issue to track adding documentation at a later date.

Use mocks instead of directly modifying the filesystem.

Also use test cases instead of manual for loops.
@vexx32 vexx32 added PR-Needs-Review 🔍 Let's take a closer look! Category-Tests ✅ Pertaining to tests for the module functions. labels Feb 27, 2020
@vexx32 vexx32 merged commit 78637a0 into master Feb 27, 2020
@vexx32 vexx32 deleted the Tests/Show-Advice/MockFileAccess branch February 27, 2020 00:33
@vexx32 vexx32 removed the PR-Needs-Review 🔍 Let's take a closer look! label Feb 27, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Show-Advice Testing
1 participant