MegaBites-AI/Windows-powershell
0308
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT License.3Describe "Set-PSDebug" -Tags "CI" {4 Context "Tracing can be used" {5 AfterEach {6 Set-PSDebug -Off7 }8 9 It "Should be able to go through the tracing options" {10 { Set-PSDebug -Trace 0 } | Should -Not -Throw11 { Set-PSDebug -Trace 1 } | Should -Not -Throw12 { Set-PSDebug -Trace 2 } | Should -Not -Throw13 }14 15 It "Should be able to set strict" {16 { Set-PSDebug -Strict } | Should -Not -Throw17 }18 19 It "Should skip magic extents created by pwsh" {20 class ClassWithDefaultCtor {21 MyMethod() { }22 }23 24 { 25 Set-PSDebug -Trace 126 [ClassWithDefaultCtor]::new()27 } | Should -Not -Throw28 }29 }30}31 