# pester/pester

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pester-pester).**

3,262 stars · 478 forks · PowerShell · other

## Links

- GitHub: https://github.com/pester/Pester
- Homepage: https://pester.dev/
- awesome-repositories: https://awesome-repositories.com/repository/pester-pester.md

## Topics

`assertions` `bdd` `bdd-framework` `mock` `mocking` `pester-tests` `powershell` `powershell-tests` `tdd` `tdd-framework` `testing`

## Description

Pester is a PowerShell testing framework and behavior-driven development tool used to write and run automated tests for scripts and modules. It defines and verifies software behavior through human-readable specifications to validate that code behaves as expected.

The project includes a native mocking library that replaces real functions and commands with controlled implementations, allowing for the isolation of code and verification of command invocations without altering the system environment. It also functions as a code coverage tool that measures the percentage of executed lines during test runs to identify untested logic and branches.

Broad capabilities cover the management of test lifecycles through shared setup and teardown logic and the organization of test suites into nested groups. The framework provides specialized assertions to validate code behavior and integrates with continuous integration servers to automate test execution within build pipelines.

## Tags

### Testing & Quality Assurance

- [Automated Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-execution.md) — Executes scripts containing test definitions and reports whether code behaves as expected through detailed console output. ([source](https://cdn.jsdelivr.net/gh/pester/pester@main/README.md))
- [Behavior Driven Development Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/test-levels-and-types/behavior-driven-development-frameworks.md) — Functions as a behavior-driven development framework using human-readable specifications to verify software behavior.
- [Assertion Libraries](https://awesome-repositories.com/f/testing-quality-assurance/assertion-libraries.md) — Ships a versatile set of specialized assertions for validating code outputs, file states, and general logic.
- [Interaction Verifiers](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/test-automation-tools/test-recording-tools/mock-interaction-recorders/interaction-verifiers.md) — Provides utilities to verify the number of times and the specific arguments used in mocked command calls. ([source](https://pester.dev/docs/usage/mocking))
- [Function Behavior Replacement](https://awesome-repositories.com/f/testing-quality-assurance/function-call-tracking/function-behavior-replacement.md) — Intercepts function calls to return predefined values, simulating dependencies by replacing real command behavior. ([source](https://pester.dev/docs/usage/mocking))
- [Mocking and Spying Libraries](https://awesome-repositories.com/f/testing-quality-assurance/mocking-and-spying-libraries.md) — Includes a native mocking library to replace real functions and commands with controlled implementations for isolation.
- [Outcome Verification](https://awesome-repositories.com/f/testing-quality-assurance/outcome-verification.md) — Compares actual values against expected criteria to determine if a test passes or fails. ([source](https://pester.dev/docs/assertions/should-command))
- [PowerShell Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/powershell-testing-frameworks.md) — Provides a complete framework for writing and running automated tests to validate the behavior of PowerShell scripts.
- [Dependency Mocking](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/dependency-mocking.md) — Replaces real function dependencies with controlled substitutes to isolate code under test. ([source](https://cdn.jsdelivr.net/gh/pester/pester@main/README.md))
- [Command Interception](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/dependency-mocking/automated-mock-generation/dynamic-mock-objects/command-interception.md) — Provides a dynamic engine that replaces PowerShell commands and functions at runtime to intercept calls and control return values.
- [PowerShell](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/powershell.md) — Provides a dedicated framework for writing and running automated unit tests for PowerShell scripts and modules.
- [State Expectation Validation](https://awesome-repositories.com/f/testing-quality-assurance/state-expectation-validation.md) — Compares current system states and values against expected values to verify that code behavior meets specific criteria. ([source](https://cdn.jsdelivr.net/gh/pester/pester@main/README.md))
- [Code Coverage Analysis](https://awesome-repositories.com/f/testing-quality-assurance/code-coverage-analysis.md) — Provides tools and metrics to measure the extent to which source code is executed by a test suite.
- [Code Coverage Tools](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-coverage-tools.md) — Measures the percentage of executed lines during test runs to identify untested logic and branches.
- [Test Lifecycle and Execution Control](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control.md) — Implements mechanisms for managing test suite organization and execution flow via setup and teardown hooks.
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-lifecycle-hooks.md) — Provides mechanisms for executing setup and teardown logic before and after tests to ensure environment consistency. ([source](https://pester.dev/docs/quick-start))
- [Nested Setup Nodes](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/test-setup-orchestrators/nested-setup-nodes.md) — Organizes test suites into hierarchical blocks to manage scope and shared setup logic.
- [Test Suite Organization](https://awesome-repositories.com/f/testing-quality-assurance/unit-testing-frameworks/test-suite-organization.md) — Offers methods for structuring and grouping individual test functions into manageable suites using nested blocks. ([source](https://pester.dev/docs/quick-start))

### Programming Languages & Runtimes

- [Native Runtime Execution](https://awesome-repositories.com/f/programming-languages-runtimes/native-runtime-execution.md) — Runs tests directly within the PowerShell runtime to leverage native language features and system-level access.

### Software Engineering & Architecture

- [Mock Implementations](https://awesome-repositories.com/f/software-engineering-architecture/metadata-attachments/procedure/mock-implementations.md) — Replaces actual function implementations with fake counterparts to isolate logic and test interactions without side effects.

### DevOps & Infrastructure

- [CI Pipeline Integrations](https://awesome-repositories.com/f/devops-infrastructure/ci-cd-pipelines/ci-pipeline-integrations.md) — Provides native support for executing automated testing pipelines within continuous integration environments. ([source](https://cdn.jsdelivr.net/gh/pester/pester@main/README.md))
- [Continuous Integration Pipelines](https://awesome-repositories.com/f/devops-infrastructure/continuous-integration-pipelines.md) — Integrates automated test execution into continuous integration pipelines to validate code quality before merging.

### Part of an Awesome List

- [Testing](https://awesome-repositories.com/f/awesome-lists/devtools/testing.md) — BDD-style testing framework for scripts.
