Skip to content

(#298) Refactor Show-Advice Tests - #361

Merged
vexx32 merged 1 commit into
masterfrom
Tests/Show-Advice/MockFileAccess
Feb 27, 2020
Merged

vexx32 merged 1 commit into
masterfrom
Tests/Show-Advice/MockFileAccess

Conversation

@vexx32

@vexx32 vexx32 commented Feb 27, 2020 •

Copy link
Copy Markdown
Collaborator

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