File size: 881 Bytes
8c763fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Set-PSDebug" -Tags "CI" {
    Context "Tracing can be used" {
        AfterEach {
            Set-PSDebug -Off
        }

        It "Should be able to go through the tracing options" {
            { Set-PSDebug -Trace 0 } | Should -Not -Throw
            { Set-PSDebug -Trace 1 } | Should -Not -Throw
            { Set-PSDebug -Trace 2 } | Should -Not -Throw
        }

        It "Should be able to set strict" {
            { Set-PSDebug -Strict } | Should -Not -Throw
        }
        
        It "Should skip magic extents created by pwsh" {
            class ClassWithDefaultCtor {
                MyMethod() { }
            }
            
            { 
                Set-PSDebug -Trace 1
                [ClassWithDefaultCtor]::new()
            } | Should -Not -Throw
        }
    }
}