Skip to content

Instantly share code, notes, and snippets.

@cdhunt cdhunt/pestergenerator.ps1
Last active Jan 23, 2018

Embed
What would you like to do?
#requires -Module NameIt
while ($true) {
$tc = Get-Random -Minimum 1 -Maximum 15
$t = 0
$c=ig "[noun]"
Write-Host "`t Context $c" -ForegroundColor Green
while($t -le $tc) {
$sleep = Get-Random -Minimum 25 -Maximum 800
$pass = (Get-Random -Minimum 1 -Maximum 100) -lt 75
$testname = ig "[noun] Should Be [adjective]"
Start-Sleep -Milliseconds $sleep
if ($pass) {Write-Host "`t`t [+] $testname " -ForegroundColor Green -NoNewline} else {Write-Host "`t`t [-] $testname " -ForegroundColor Red -NoNewline}
Write-Host ${sleep}ms -ForegroundColor Gray
$t++
}
Start-Sleep -Milliseconds 150
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.