Skip to content
Jon Wagner edited this page Feb 8, 2013 · 1 revision

PSMock v Pester

PSMock was inspired by the great work by the Pester team. Unfortunately, we hit few limitations, so we needed to extend it on our own, and ended up with an entirely separate implementation. Pester's Mock was designed to work within its test suite, so it wasn't really designed to stand alone.

Here are some differences:

  • PSMock works in any context or scope. Pester Mock doesn't work outside of the Pester framework.
  • PSMock can mock functions that don't exist.
  • PSMock has Mock Contexts.
  • PSMock can remove individual mocks and individual cases.
  • PSMock can track calls on a mock case level.
  • PSMock doesn't get confused if you reload the framework while mocks are active.

You can use PSMock interactively from the PowerShell command line, or from within your program or testing framework.

Clone this wiki locally