Guest User

Untitled

a guest
Jan 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Get-Module Pester | Remove-Module
  2. Import-Module ./Pester.psd1
  3.  
  4. $sb = {
  5. Add-Dependency {
  6. Start-Sleep -Seconds 10
  7. }
  8.  
  9. Describe "integration test" {
  10.  
  11. BeforeAll {
  12. Start-Sleep -Seconds 10
  13. }
  14.  
  15. It "test 1" {
  16. Start-Sleep -Seconds 10
  17. }
  18.  
  19. It "test 2" {
  20. Start-Sleep -Seconds 10
  21. }
  22. }
  23. }
  24. $ss = $ExecutionContext.SessionState
  25.  
  26. # invoking internal pester function
  27. # because the Find function is not
  28. # published (yet)
  29. (Measure-Command {
  30. &(Get-Module Pester) {
  31. param ($SessionState, $ScriptBlock)
  32. $container = New-BlockContainerObject -ScriptBlock $ScriptBlock
  33. Find-Test -BlockContainer $container -SessionState $SessionState
  34. } -SessionState $ss -ScriptBlock $sb
  35. }).TotalMilliseconds
Add Comment
Please, Sign In to add comment