Giter Site home page Giter Site logo

pester / vscode-adapter Goto Github PK

View Code? Open in Web Editor NEW
58.0 4.0 13.0 1.12 MB

Run PowerShell Pester Tests with Visual Studio Code

License: MIT License

PowerShell 28.22% TypeScript 71.54% JavaScript 0.25%
vscode vscode-extension testing visual-studio-code pester powershell scripts test hacktoberfest

vscode-adapter's Introduction

Pester Test Adapter for Visual Studio Code Latest Installs vsix Build Analysis

License: MIT GitHub stars

🚧 THIS EXTENSION IS IN PREVIEW STATE, THERE ARE GOING TO BE BUGS 🚧

This extension provides the ability to run Pester tests utilizing the native Testing functionality first introduced in Visual Studio Code 1.59

Example

Highlights

🔍 Pester Test Browser 🐞 Debugging Support 👩‍💻 Native PowerShell Extension Integration 👨‍👧‍👦 Expands Test Cases

Extension Prerequisites

  • Pester 5.2.0 or later (sorry, no Pester 4 support)
  • PowerShell 7+ or Windows PowerShell 5.1

Usage

The extension will automatically discover all .Tests.ps1 Pester files in your workspace, you can then run tests either from the Tests pane or from the green arrows that will appear adjacent to your tests.

Installing the latest preview VSIX

Preview VSIX extension packages are generated upon every commit to main and every pull request update. To install a beta build:

  1. Click the green checkmark next to the latest commit
  2. Click Details next to the 👷‍♂️ Build Visual Studio Code Extension task
  3. Click Artifacts in the upper right of the window
  4. Download the latest artifact zip and unzip it, it should be named vsix-{version}
  5. Open the resulting folder in vscode, right click the .vsix file, and choose Install Extension VSIX near the bottom.
  6. Alternatively in vscode you can hit F1 and choose Extensions: Install from VSIX and browse for the vsix file.

Configuration

This extension will use the PowerShell Extension Pester verbosity settings for the output.

Troubleshooting

The Pester Output pane maintains a log of the activities that occur with the Pester extension. You can use Set Log Level in the command palette to increase the log level to debug or trace to get more information about what is going on. Include this information when submitting an issue along with reproduction steps.

Known Issues

  • For test history purposes, a test is uniquely identified by its full path, e.g. Describe/Context/It. If you rename a test or move a test to another context/describe, it will be treated as a new test and test history will be reset
  • If you do not have any .tests.ps1 files in your directory upon startup, you will currently need to reload vscode for the extension to activate after you create the .tests.ps1 file. This is is a known issue that is being tracked

vscode-adapter's People

Contributors

antoinemartin avatar dependabot[bot] avatar johlju avatar justingrote avatar nohwnd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-adapter's Issues

Tests pane doesn't show up for my projects

After some time of successfully usage of this extension, I've started experiencing an issue where the Testing panel stopped showing up. While digging through the Logs (Extension Host) I've noticed the following line (for a session when I have my project opened):

[2021-12-15 22:40:26.699] [exthost] [info] Not activating extension 'pspester.pester-test': Timed out while searching for 'workspaceContains' pattern **/*.[tT]ests.[pP][sS]1

Any idea of how to fix that?

There are actually a few other extensions that also timeout in the same fashion:

[2021-12-15 23:14:50.580] [exthost] [info] Not activating extension 'ms-azuretools.vscode-azurefunctions': Timed out while searching for 'workspaceContains' pattern **/host.json
[2021-12-15 23:14:50.580] [exthost] [info] Not activating extension 'ms-dotnettools.csharp': Timed out while searching for 'workspaceContains' pattern *.csproj,*.sln,*.slnf,*.csx,*.cake,**/*.csproj,**/*.sln,**/*.slnf,**/*.csx,**/*.cake

Thanks!

Feature Request: Add a "Pause" Button in Test Explorer bar

Hi,
Thanks a lot for this great extension.
I think it would be practical to add a "Pause" button that will stop discovery, stop autorun on save.
Even if there is the setting pester.autoRunOnsave , this button will allow more dynamic interaction between code change and tests Runs.

My scenario is that during the conversion of pester v4 to pester v5 , this extension run the v4 tests and I would prefer to pause theses tests during the conversion time.
Thank you for your time on this.
image

A new setting to run a PowerShell command in the same process before first discovery

When running tests in a PowerShell module project based on the Sampler project (or similar tools) there is a need to run build.ps1 prior to running any tests. The build.ps1 sets up the PowerShell session with the correct path to modules in $env:PSModulePath etc.

Suggest adding a setting that takes a path that is run the first time in each new session, before first discovery.

In our case the setting would hold ./build.ps1 -Task noop

Powershell 5.1 has different test IDs if unicode is used

This is only an issue if you swap between PS7 and PS5.1 in the middle of a session, the tests will no longer identify.

Ways to fix:

  • Maybe base64 the IDs
  • Rediscover all tests if it gets switched and prepend with the exePath, this would allow different tests for different runners.

When running an individual test it tries to run all test

When choosing "Run Test" from the individual test "list" (first play symbol):

image

it tries to run all found tests

image

If choosing the second "play button" called "Debug Test" the individual test run as expected.

FYI, it stops and asks for MainGitBranch because it runs a test that is not part of the project, a test that requires parameters to run. See issue #20.

How I can see test log from tests tree?

My example:

Describe 'Open Document template' {
	Describe '<Name>' -ForEach @(
		$DestinationTemplateFile | Get-Item |
		ForEach-Object { @{ Name = $_.Name; FullName = $_.FullName } }
	) {
		It 'is valid (by ODFValidator)' {
			{
				java -D"file.encoding=UTF-8" -jar $ODFValidatorJarPath -e -w $FullName
				if ( $LASTEXITCODE -ne 0 )
				{
					Write-Error -Message 'Validation failed!' -ErrorAction 'Stop';
				};
			} | Should -Not -Throw
		}
	}
}

One test failed. How I can see test output from test tree?

Cannot run\discover tests when there are space characters in the path

Hi,

I've noticed that it if the path to my .Tests.ps1 files contain space characters.

As far as I understand, the issue us caused by the fact that the path to the script file is provided to PesterInterface.ps1 script without being wrapped into quotes, which leads the script to misinterpret the path value.

I'm not so good with TypeScript, but I think that the problem can be fixed here (by appending quotes on the both ends of testLine):

Pester Test Adapter should error if Pester is not Installed

Trying to expand in test explorer and Pester is not available to the session makes that test no longer able to expand. When Pester is available (running build.ps1 in this case) clicking on another test it tries to expands.

Everything is a bit slow since I have the code on /mnt/c.

FailsOnMissingPester

Fails to expand tests in test explorer on macOS

When trying to expand tests on macOS it fails with errors:

PS /Users/johlju/source/SqlServerDsc> . '/Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1' -Discovery -PipeName PesterTestController-85984 /Users/johlju/source/SqlServerDsc/tests/Unit/DSC_SqlAgentAlert.Tests.ps1 -Verbosity None
Connecting to pipe PesterTestController-85984
Invoking step Start failed:
Result :Error :
MethodInvocationException: /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1:295:9
Line |
 295 |          $__TestAdapterNamedPipeClient.Connect(5000)
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Connect" with "1" argument(s): "The operation has timed out."

at <ScriptBlock>, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 295
at Invoke-PluginStep, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 1750
at Invoke-Pester<End>, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 5080
at Invoke-Main, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 386
at <ScriptBlock>, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 445
at <ScriptBlock>, <No file>: line 1

System.Management.Automation.RuntimeException: Invoking step Start failed:
Result :Error :
MethodInvocationException: /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1:295:9
Line |
 295 |          $__TestAdapterNamedPipeClient.Connect(5000)
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Connect" with "1" argument(s): "The operation has timed out."

at <ScriptBlock>, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 295
at Invoke-PluginStep, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 1750
at Invoke-Pester<End>, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 5080
at Invoke-Main, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 386
at <ScriptBlock>, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 445
at <ScriptBlock>, <No file>: line 1

at Assert-Success, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 1808
at Invoke-PluginStep, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 1769
at Invoke-Pester<End>, /Users/johlju/source/SqlServerDsc/output/RequiredModules/Pester/5.2.2/Pester.psm1: line 5080
at Invoke-Main, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 386
at <ScriptBlock>, /Users/johlju/.vscode/extensions/pspester.pester-test-0.0.2/Scripts/PesterInterface.ps1: line 445
at <ScriptBlock>, <No file>: line 1

When starting up VS Code the status of tests are remembered

After tests has run and in this case passed, it is reported as passed in test explorer (marked green). When restarting Visual Studio Code the green indicator is still present, and expanding the test file in test explorer the green mark is also added to the code file (if made visible using "Go To Test"). This is even if there has been code changes to the test that is marked green.

Suggest making all test to have "not run" indicator when starting VS Code. Otherwise it could give the impression that the test works with new code changes, even though the test was never run with those new code changes.

Need a extension setting for choosing what paths to use to list test

When doing development for the repo SqlServerDsc we run

.\build.ps1 -ResolveDependency -Tasks build

that gives us a folder structure like the following (just the important parts listed):

C:\source
└───SqlServerDsc
    │   build.ps1
    │
    ├───output
    │   └───RequiredModules
    │   └───SqlServerDsc
    ├───source
    │
    └───tests
        └───QA
                module.tests.ps1
        └───Unit
        └───Integration

In the folder RequiredModules we have a lot of dependencies for the pipeline (among other things). The problem is that those modules in that folder contain a lot of tests that are also listed, but they are not part of the project.

The test from the red mark are not part of the SqlServerDsc project.
image

Suggest adding a extension settings for setting what paths are used for reading tests, e.g. ProjectTestFolders.

Is there a way to change the startup directory for the PowerShell process?

It seems the current startup directory is the VSCode app directory ($Env:LocalAppData\Programs\Microsoft VS Code in Windows). Is there a way to set it, for example, to the VSCode workspace folder (${workspaceFolder})?

I know there is $PSScriptRoot to reference the current test file's directory, but there seems to be no straight forward/consistent way to reference the workspace root (directory).

If multiple Pester modules are loaded into the session `Get-DurationString` fails

When multiple version of Pester is imported into the session from different locations the function Get-DurationString fails.

Path : C:\Users\johan.ljunggren\Documents\PowerShell\Modules\Pester\5.3.0\Pester.psm1

Path : C:\source\FileSystemDsc\output\RequiredModules\Pester\5.3.0\Pester.psm1
[-] Context DSC_FileSystemAccessRule\Set-TargetResource.When the system is not in the desired state.When the access rules fails to be set failed
 CommandNotFoundException: The term 'Pester Pester' is not recognized as a name of a cmdlet, function, script file, or executable program.
 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
 at Get-DurationString, C:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.3\Scripts\PesterInterface.ps1:200
 at New-TestObject, C:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.3\Scripts\PesterInterface.ps1:244
 at <ScriptBlock>, C:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.3\Scripts\PesterInterface.ps1:326

MultiplePester

I think this line should get the highest version of Pester that is imported into the session - if multiple exist with the same version then it should return the same.

$p = Get-Module Pester

Maybe change to:

Get-Module Pester | Sort-Object version -Descending | Select -First 1

♻️ Pester run pipeline

Firm up the Pester test types for the final API and optimize for async operations.

Primarily, Pester is not very efficient unless you run as many tests as you can together, so we want to take runhandler requests and queue them with a timer, and then execute once the timer expires

🙏 Feature Request: AST-Based Test Discovery that doesn't run test discovery logic

It's related probably to: TylerLeonhardt/vscode-pester-test-adapter#16

autoexecute

PS C:\Support\GitHub\GpoZaurr> . 'c:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1' -Discovery -PipeName PesterTestController-17564 c:\Support\GitHub\GpoZaurr\Tests\GPOPermissions.Tests.ps1 -Verbosity None
Import-Module : The value Ignore is not supported for an ActionPreference variable. The provided value sh
ould be used only as a value for a preference parameter, and has been replaced by the default value. For
more information, see the Help topic, "about_Preference_Variables."
At C:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1:337
 char:15
+     $Pester = Import-Module Pester -PassThru
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ImportModuleCom
   mand

The expression after '&' in a pipeline element produced an object that was not valid. It must result in a
 command name, a script block, or a CommandInfo object.
At C:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1:338
 char:7
+     & $Pester {
+       ~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : BadExpression

And

PS C:\Support\GitHub\GpoZaurr> . 'c:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1' -Discovery -PipeName PesterTestController-17564 c:\Support\GitHub\GpoZaurr\GPOZaurr.Tests.ps1 -Verbosity None
Import-Module : The value Ignore is not supported for an ActionPreference variable. The provided value sh
ould be used only as a value for a preference parameter, and has been replaced by the default value. For
more information, see the Help topic, "about_Preference_Variables."
At C:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1:337
 char:15
+     $Pester = Import-Module Pester -PassThru
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ImportModuleCom
   mand

The expression after '&' in a pipeline element produced an object that was not valid. It must result in a
 command name, a script block, or a CommandInfo object.
At C:\Users\przemyslaw.klys\.vscode\extensions\pspester.pester-test-0.0.1\Scripts\PesterInterface.ps1:338
 char:7
+     & $Pester {
+       ~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : BadExpression



ModuleName: GPOZaurr Version: 0.0.129
PowerShell Version: 5.1.19041.1151
PowerShell Edition: Desktop
Required modules: 
   [>] PSSharedGoods Version: 0.0.208
   [>] ADEssentials Version: 0.0.130
   [>] PSWriteHTML Version: 0.0.158
   [>] CimCmdlets
   [>] Microsoft.PowerShell.Management
   [>] Microsoft.PowerShell.Utility
   [>] Microsoft.PowerShell.Security

Import-Module : The value Ignore is not supported for an ActionPreference variable. The provided value sh
ould be used only as a value for a preference parameter, and has been replaced by the default value. For
more information, see the Help topic, "about_Preference_Variables."
At C:\Support\GitHub\GpoZaurr\GPOZaurr.Tests.ps1:46 char:1
+ Import-Module $PSScriptRoot\*.psd1 -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ImportModuleCom
   mand

Export-ModuleMember : The value Ignore is not supported for an ActionPreference variable. The provided va
lue should be used only as a value for a preference parameter, and has been replaced by the default value
. For more information, see the Help topic, "about_Preference_Variables."
At C:\Users\przemyslaw.klys\Documents\WindowsPowerShell\Modules\Pester\5.1.1\Pester.psm1:15353 char:1
+ & $script:SafeCommands['Export-ModuleMember'] @(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Export-ModuleMember], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ExportModuleMem
   berCommand

Adapter won't work if path to VSCode has spaces.

Here is log from Pester Output panel:

22:08:11.248 INFO [dt.resolveHandler] Initializing Pester Test Controller and watching for Pester Files 
22:08:11.560 INFO [dt.watchWorkspaces] Detected Pester File:  d:\Temp\TestsWithPester\Tests\TestsWithPester.Tests.ps1 
22:08:17.008 DEBUG [undefined.<anonymous>] Run invoked on undiscovered testFile TestsWithPester.Tests.ps1, discovery will be run first 
22:08:17.012 DEBUG [dt.resolveHandler] Adding to Discovery Queue:  D:\TEMP\TESTSWITHPESTER\TESTS\TESTSWITHPESTER.TESTS.PS1 
22:08:17.118 INFO [dt.<anonymous>] Starting Test Discovery of 1 files 
22:08:17.144 INFO [dt.startPesterInterface] Starting PowerShell testing instance: C:\Program Files\PowerShell\7\pwsh.exe 
22:08:17.147 DEBUG [dt.startPesterInterface] Running Script in PS Worker: & 'D:\Visual Studio Code\data\extensions\pspester.pester-test-2021.9.1\Scripts\PesterInterface.ps1' -Discovery 'd:\Temp\TestsWithPester\Tests\TestsWithPester.Tests.ps1' 

It hangs after the last line and nothing (visible) happens.

Here is a capture from VSCode:

Animation

If I click on 'Run Pester Tests' in Context Menu of TestsWithPester.Tests.ps1 Tab then tests are executed just fine without any output in Pester Panel.

Pester Tester v2021.9.1
Pester 5.3.1
Powershell Core 7.1.4

Errors in BeforeAll/AfterAll are not reflected in the UI

Consider the following test file:

BeforeAll {
  Write-Error "Stop!!!" -ErrorAction 'Stop'
}

Context 'Context' {
  It '$True is $True' { $True | Should -BeExactly $True }
  It '$False is $False' { $False | Should -BeExactly $False }
}

The UI (gutter icons, test explorer) looks like the tests were evaluated (the previous passed/failed states reappear), while only the 'Test Output' in the terminal indicates the error.

Many errors if there are `-ForEach` param

I see many errors for there test fragment:

Describe 'Open Document template' {
	Describe '<Name>' -ForEach @(
		$DestinationTemplateFile | Get-Item |
		ForEach-Object { @{ Name = $_.Name; FullName = $_.FullName } }
	) {
		It 'is valid (by ODFValidator)' {
			{
				java -D"file.encoding=UTF-8" -jar $ODFValidatorJarPath -e -w $FullName
				if ( $LASTEXITCODE -ne 0 )
				{
					Write-Error -Message 'Validation failed!' -ErrorAction 'Stop';
				};
			} | Should -Not -Throw
		}
	}
}

All test passed. But i see in console:

Starting discovery in 1 files.
Discovery found 1 tests in 243ms.
Running tests.
[-] Describe Open Document template.<Name> failed
 RuntimeException: Unsupported level out output 'c:\Users\sergei.s.betke\Documents\DocTemplates\tests\template\.Tests.ps1'
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 13191
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2007
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1949
 в Invoke-ScriptBlock, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2113
 в Invoke-TestItem, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1225
 в Invoke-Block, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 826
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 881
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1988
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1949
 в Invoke-ScriptBlock, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2113
 в Invoke-Block, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 928
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 881
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1988
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1949
 в Invoke-ScriptBlock, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2113
 в Invoke-Block, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 928
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 881
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1988
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1949
 в Invoke-ScriptBlock, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2113
 в Invoke-Block, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 928
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1662
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.ps1: строка 3
 в <ScriptBlock>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 3154
 в Invoke-InNewScriptScope, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 3161 в Run-Test, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 1665
 в Invoke-Test, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 2465
 в Invoke-Pester<End>, C:\Users\sergei.s.betke\Documents\WindowsPowerShell\Modules\Pester\5.3.0\Pester.psm1: строка 5225
 в Invoke-Main, C:\Users\sergei.s.betke\.vscode\extensions\pspester.pester-test-0.0.3\Scripts\PesterInterface.ps1: строка 392 в <ScriptBlock>, C:\Users\sergei.s.betke\.vscode\extensions\pspester.pester-test-0.0.3\Scripts\PesterInterface.ps1: строка 396
 в <ScriptBlock>, <Нет файла>: строка 1
Tests completed in 3.06s
Tests Passed: 1, Failed: 0, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 1
  - Open Document template.<Name>
PS C:\Users\sergei.s.betke\Documents\DocTemplates>

🐛 5.1 Compatability: Will fail on unicode characters in test names

If a unicode character (e.g. emoji) is present in 5.1, it will fail the pester test discovery. This should probably be opened as a downstream pester issue instead and advice will be to use 7 if you want emojis in your test names.

Invoke-pester -Configuration $config

Connecting to pipe PesterTestController-7976
Discovery: Starting test discovery in 1 test containers. 

Starting discovery in 1 files.
Discovery: Discovering tests in C:\Users\JGrote\Projects\vscode-adapter\sample\Tests\Basic.Tests.ps1 
Discovering in C:\Users\JGrote\Projects\vscode-adapter\sample\Tests\Basic.Tests.ps1.
[-] Discovery in C:\Users\JGrote\Projects\vscode-adapter\sample\Tests\Basic.Tests.ps1 failed with:
System.Management.Automation.ParseException: At 
C:\Users\JGrote\Projects\vscode-adapter\sample\Tests\Basic.Tests.ps1:48 char:51
+     @{ Name = 'giraffe'; Symbol = '🦒'; Kind = 'Animal' }
+                                                   ~~~~~~~~~
Unexpected token 'Animal' }
) {
    It 'Returns' in expression or statement.

At C:\Users\JGrote\Projects\vscode-adapter\sample\Tests\Basic.Tests.ps1:48 char:51

Update icon if possible

Hi VS Code PM here 👋

We decided to make your extension featured this month https://marketplace.visualstudio.com/vscode
The issue is that the Marketplace site does not render your icon nicely, since it is very white. Thus the list looks a bit broken.

I was wondering if it would be possible to update the icon so it looks better in the list?
If this is not possible no problem. We will fix the rendering on our side in the future and we can then feature your extension.

Thanks a lot
Isidor

Reports status passed even if the test failed

When expanding the tests for file DSC_SqlAgentAlert.Tests.ps1 then running the tests for the entire file each test (using "Run Test") fails with an error message, that is not shown when running in "Debug Test", so that is probably another issue. Though, I wasn't expecting it to report all test as passed. 🙂

Build succeeded. 1 tasks, 0 errors, 0 warnings 00:00:03.3297802
C:\source\SqlServerDsc [f/support-pester-5 ≡ +0 ~3 -0 !]> . 'c:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.2\Scripts\PesterInterface.ps1' -Discovery -PipeName PesterTestController-35192 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1 -Verbosity None
Connecting to pipe PesterTestController-35192
C:\source\SqlServerDscPS> . 'c:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.2\Scripts\PesterInterface.ps1' -PipeName PesterTestController-35192 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:46 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:90 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:97 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:114 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:124 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:136 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:147 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:157 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:162 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:172 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:184 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:198 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:204 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:218 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:219 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:233 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:253 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:267 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:286 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:300 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:317 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:336 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:337 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:351 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:368 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:382 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:400 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:418 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:432 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:452 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:576 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:583 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:603 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:611 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:631 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:646 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:661 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:677 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:692 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:707 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:722 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:737 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:764 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:769 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:774 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:790 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:817
Connecting to pipe PesterTestController-35192

Starting discovery in 1 files.
Discovery finished in 36ms.
Running tests.
[-] Context DSC_SqlAgentAlert\Get-TargetResource.When Connect-SQL returns nothing failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Get-TargetResource.When the system is not in the desired state failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Get-TargetResource.When the system is in the desired state for a sql agent alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert does not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert should not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When enforcing a severity alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When an alert does not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a severity alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a message alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When Connect-SQL returns nothing failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Present failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Absent failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

Tests completed in 1.5s
Tests Passed: 12, Failed: 18, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 12
  - DSC_SqlAgentAlert\Get-TargetResource.When Connect-SQL returns nothing
  - DSC_SqlAgentAlert\Get-TargetResource.When the system is not in the desired state
  - DSC_SqlAgentAlert\Get-TargetResource.When the system is in the desired state for a sql agent alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert does not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert should not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When enforcing a severity alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When an alert does not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a severity alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a message alert
  - DSC_SqlAgentAlert\Set-TargetResource.When Connect-SQL returns nothing
  - DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Present
  - DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Absent

image

Running tests gives error `Unsupported level out output`

When expanding the tests for file DSC_SqlAgentAlert.Tests.ps1 then running the tests for the entire file each test (using "Run Test") fails with an error message Unsupported level out output. That is not shown when running in "Debug Test".

Build succeeded. 1 tasks, 0 errors, 0 warnings 00:00:03.3297802
C:\source\SqlServerDsc [f/support-pester-5 ≡ +0 ~3 -0 !]> . 'c:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.2\Scripts\PesterInterface.ps1' -Discovery -PipeName PesterTestController-35192 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1 -Verbosity None
Connecting to pipe PesterTestController-35192
C:\source\SqlServerDscPS> . 'c:\Users\johan.ljunggren\.vscode\extensions\pspester.pester-test-0.0.2\Scripts\PesterInterface.ps1' -PipeName PesterTestController-35192 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:46 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:90 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:97 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:114 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:124 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:136 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:147 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:157 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:162 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:172 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:184 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:198 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:204 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:218 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:219 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:233 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:253 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:267 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:286 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:300 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:317 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:336 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:337 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:351 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:368 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:382 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:400 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:418 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:432 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:452 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:576 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:583 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:603 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:611 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:631 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:646 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:661 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:677 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:692 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:707 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:722 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:737 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:764 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:769 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:774 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:790 c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1:817
Connecting to pipe PesterTestController-35192

Starting discovery in 1 files.
Discovery finished in 36ms.
Running tests.
[-] Context DSC_SqlAgentAlert\Get-TargetResource.When Connect-SQL returns nothing failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Get-TargetResource.When the system is not in the desired state failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Get-TargetResource.When the system is in the desired state for a sql agent alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert does not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert should not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When enforcing a severity alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When an alert does not exist failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a severity alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a message alert failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When Connect-SQL returns nothing failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Present failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

[-] Context DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Absent failed
 RuntimeException: Unsupported level out output 'c:\source\SqlServerDsc\tests\Unit\DSC_SqlAgentAlert.Tests.ps1'

Tests completed in 1.5s
Tests Passed: 12, Failed: 18, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 12
  - DSC_SqlAgentAlert\Get-TargetResource.When Connect-SQL returns nothing
  - DSC_SqlAgentAlert\Get-TargetResource.When the system is not in the desired state
  - DSC_SqlAgentAlert\Get-TargetResource.When the system is in the desired state for a sql agent alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert does not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When the alert should not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is not in the desired state.When enforcing a severity alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When an alert does not exist
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a severity alert
  - DSC_SqlAgentAlert\Test-TargetResource.When the system is in the desired state.When enforcing a message alert
  - DSC_SqlAgentAlert\Set-TargetResource.When Connect-SQL returns nothing
  - DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Present
  - DSC_SqlAgentAlert\Set-TargetResource.When the system is not in the desired state and Ensure is set to Absent

When running the same test with "Debug Test" they pass correctly:

...

Mock: Behavior for DSC_SqlAgentAlert - Connect-SQL was executed. 
   [+] Should throw the correct error when Drop() method was called with invalid operation 82ms (77ms|5ms)
Mock: Getting all verifiable mock behaviors in this scope. 
Mock: We are in a test. Finding all behaviors in this test. 
   [+] Should call all verifiable mocks 20ms (15ms|6ms)
Mock: Removing function PesterMock_DSC_SqlAgentAlert_Connect-SQL_22f17be4-aa07-4dce-9263-f5d9f52a3de2 and aliases Connect-SQL, SqlServerDsc.Common\Connect-SQL for Connect-SQL. 
Mock: Removed function PesterMock_DSC_SqlAgentAlert_Connect-SQL_22f17be4-aa07-4dce-9263-f5d9f52a3de2 from module DSC_SqlAgentAlert session state. 
Mock: Removed alias Connect-SQL from module DSC_SqlAgentAlert session state. 
Mock: Removed alias SqlServerDsc.Common\Connect-SQL from module DSC_SqlAgentAlert session state. 
Tests completed in 4.4s
Tests Passed: 30, Failed: 0, Skipped: 0 NotRun: 0

Normalize all Windows paths to uppercase

On Windows, javascript and powershell format paths differently, leading to ID mismatch issues. Normalize to uppercase since it is case insensitive on windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.