Skip to content

Unable to Mock when running Pester in its own process/scope #2061

Answered by fflaten
tbergstedt asked this question in Q&A
Discussion options

You must be logged in to vote

You can't call Mock before Invoke-Pester in your job (which is a new process). Mocks need to be created during a Pester-run in the container where it's required. In other words, inside the ScriptToVerify.ps1 testscript.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@tbergstedt
Comment options

@nohwnd
Comment options

@tbergstedt
Comment options

@nohwnd
Comment options

@tbergstedt
Comment options

Answer selected by tbergstedt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants