All Projects → dfinke → Isepester

dfinke / Isepester

Module to integrate PowerShell Pester into ISE

Programming Languages

powershell
5483 projects

#Getting Started

You also need Pester installed https://github.com/pester/Pester

Copy .\IsePester.psm1 $env:USERPROFILE\Documents\WindowsPowerShell\Modules\IsePester

Launch ISE

Run or add this to your ISE $Profile Import-Module Pester, IsePester

#Using IsePester

Once the module is loaded, you can run Pester against a new test script by pressing Ctrl+F5 or navigate to Add-ons|Pester.

You can use IsePester to run a saved script file loaded into ISE. It muset be named to Pester conventions.

e.g. Mytest.Tests.ps1

##Sample Test

Describe 'Try Pester' {
    It 'tests a fail' { 1/0 }
    It 'tests a pass' { $true.should.be($true) }
}

alt-text

Feature

Ian Davis suggested, when working on foo.ps1 with tests in foo.tests.ps1 in the same directory, triggering the Pester shortcut while in foo.ps1, the tool should look for foo.tests.ps1 and run it if it exists; otherwise, run the current file.

This is now implemented.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].