Closed pvandervelde closed 8 years ago
They're always executed in the order they're defined, top to bottom. However, it's generally considered bad practice to write tests that depend on another test to work. In this case, I would just make a single It block with three assertions:
Describe 'My process' {
It 'Executes properly' {
& myprocess.exe
$LASTEXITCODE | Should Be 0
'c:\my\file.txt' | Should Exist
}
}
There's no need for a try/catch, since any terminating error will fail the test anyway.
I know it's not good practise but these are integration tests which may take a while so I don't really feel like using a test setup/teardown for each test because then it would really take ages. I can work with the fact that Pester executes from top to bottom :)
Is it currently possible to order tests in Pester? I'm using Pester for my integration / regression tests and would like to write tests like this
That does require that the first context block always gets executed first.
Is there a way to tell Pester to order my tests?