Files

30 lines
881 B
PowerShell
Raw Permalink Normal View History

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
2016-07-25 14:01:41 -07:00
Describe "Set-PSDebug" -Tags "CI" {
2016-05-12 13:50:46 -07:00
Context "Tracing can be used" {
AfterEach {
Set-PSDebug -Off
}
2019-01-17 15:33:35 -05:00
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
2016-05-12 13:50:46 -07:00
}
2019-01-17 15:33:35 -05:00
It "Should be able to set strict" {
{ Set-PSDebug -Strict } | Should -Not -Throw
2016-05-12 13:50:46 -07:00
}
It "Should skip magic extents created by pwsh" {
class ClassWithDefaultCtor {
MyMethod() { }
}
{
Set-PSDebug -Trace 1
[ClassWithDefaultCtor]::new()
} | Should -Not -Throw
}
2015-10-21 10:13:06 -07:00
}
}