How to test background jobs in pester

61 views
Skip to first unread message

Nilkamal Adak

unread,
Mar 25, 2015, 3:36:02 AM3/25/15
to pes...@googlegroups.com
Hi all,
I have to tests a script which include background jobs inside it. When i Mock the commands called from the job, it is not able to pick the mock one. How to pass the mocks to job context ?

Dave Wyatt

unread,
Jun 3, 2015, 2:29:37 PM6/3/15
to pes...@googlegroups.com
I don't think you'll be able to make that work.  You could unit test the code inside the job by making that part of your Pester tests (without having any background jobs involved), but once you run Start-Job, it's a whole new process which doesn't have Pester running, doesn't have any mocks, etc.
Reply all
Reply to author
Forward
0 new messages