You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe "Handles parse errors due to unknown types"-Skip:($testingLibraryUsage-or ($PSVersionTable.PSVersion-lt'5.0')) {
619
-
BeforeAll {
620
-
$script=@'
621
-
using namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels
622
-
using namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
623
-
Import-Module "AzureRm"
624
-
class MyClass { [IStorageContext]$StorageContext } # This will result in a parser error due to [IStorageContext] type that comes from the using statement but is not known at parse time
614
+
"$result"| Should -Not-BeLike $reportSummaryFor1Warning
615
+
}
616
+
}
617
+
618
+
# using statements are only supported in v5+
619
+
Describe "Handles parse errors due to unknown types"-Skip:($testingLibraryUsage-or ($PSVersionTable.PSVersion-lt'5.0')) {
620
+
BeforeAll {
621
+
$script=@'
622
+
using namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels
623
+
using namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
624
+
Import-Module "AzureRm"
625
+
class MyClass { [IStorageContext]$StorageContext } # This will result in a parser error due to [IStorageContext] type that comes from the using statement but is not known at parse time
625
626
'@
626
-
}
627
-
It "does not throw and detect one expected warning after the parse error has occured when using -ScriptDefintion parameter set" {
0 commit comments