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
* Trim out TypeNotFoundParseErrors.
* Add verbose logging and test
* fix test syntax
* add test for -path parameter set
* use pester test drive
* fix tests to not run in library usage session
* Address PR comments about additional assertion and xml comment
* Remove unused dotnet-core NuGet feed that caused build failure due to downtime
* Fix typo and move string into resources
* fix compilation error (forgot to check-in file)
* fix typo to also build for psv3
* Since the using statement was introduced only inn v5, move to block that runs only on v5+
* fix tests by moving the tests (clearly a smell that something is wrong in this test script
* write warning on parse errors instead of verbose output and tweak message
* instead of returning a warning, return a diagnostic record with a custom rule name and tweak error message
* poke build due to sporadic AppVeyor failure on setup (not a test) -> rename variable
<value>Ignoring 'TypeNotFound' parse error on type '{0}'. Check if the specified type is correct. This can also be due the type not being known at parse time due to types imported by 'using' statements.</value>
"$result"| Should -Not-BeLike $reportSummaryFor1Warning
552
552
}
553
553
}
554
+
555
+
# using statements are only supported in v5+
556
+
if (!$testingLibraryUsage-and ($PSVersionTable.PSVersion-ge [Version]'5.0.0')) {
557
+
Describe "Handles parse errors due to unknown types" {
558
+
$script=@'
559
+
using namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels
560
+
using namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
561
+
Import-Module "AzureRm"
562
+
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
563
+
'@
564
+
It "does not throw and detect one expected warning after the parse error has occured when using -ScriptDefintion parameter set" {
0 commit comments