From ab39ba70a2144186a159a1412149726d7729f68a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:58 -0400 Subject: [PATCH] Create Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tests/Private/Invoke-ZARestRequest.Tests.ps1 diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 new file mode 100644 index 0000000..984d682 --- /dev/null +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -0,0 +1,17 @@ +$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' +$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$file = Get-ChildItem "$filePath\$fileName" +. $file.FullName + +Describe $file.BaseName -Tag Unit { + it "file should exist" { + $file.FullName | should exist + } + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file.FullName -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file