Pesterize Your Code!!
summary
Step‑by‑step Pester basics with concrete examples: loading modules, mocking Get‑Service and Set‑Service, writing unit tests that run in module scope, and running integration tests against a test Octopus server via Invoke‑RestMethod. Shows using Invoke‑Pester with tags, exporting xUnit, and checking code coverage (mocked calls show 0% coverage while pure functions hit 100%). Demonstrates verifiable mocks, a create/remove environment workflow that actually runs and sometimes needs a small wait, and fixes a failing test live so the examples work end‑to‑end.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:56Agenda
- 4:34Why Test
- 6:32Test
- 7:07Simpler Code
- 9:22What You Know
- 11:49Pester Basics
- 14:44Get Bits
- 16:19Code Coverage
- 20:39Testing
- 22:37TestDriven Development
- 24:19Unit Tests
- 30:04Integration Test
related talks
03h 02mPowerShell Unit and Infrastructure Testing
39mWriting Pester Tests at Scale
43mBeyond Pester 103: Applying a Testing Mindset
37mTesting, Testing, 1...2...3: Using Pester for Infrastructure ...
43mBeyond Pester 102: Acceptance testing with PowerShell
49mUsing Pester with Test Kitchen to thoroughly test your Chocolatey Packages
59m.NET Testing Techniques You Didn’t Know You Needed
27mLiving your Pest file
