Skip to content

During the invocation of Pester, the parameter -TestName use always double quotes and causes the expansion of variables #891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LaurentDardenne opened this issue Jun 16, 2017 · 1 comment
Labels
Area-Pester Issue-Bug A bug to squash.
Milestone

Comments

@LaurentDardenne
Copy link

System Details

  • Operating system name and version:
    Windows Seven SP1 FR
PS G:\PS\FluentDateTime\Test> code -v
1.13.1
379d2efb5539b09112c793d3d9a413017d736f89

PS G:\PS\FluentDateTime\Test> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      3      2      0

PS G:\PS\FluentDateTime\Test> code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

PS G:\PS\FluentDateTime\Test> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with running Pester test inside the editor.
The name of my test use simple quotes :

Describe 'Exported variable $IsoCountiesFR'

But during the invocation -TestName use double quotes :

Invoke-Pester -Script "g:\PS\FluentDateTime\Test\Get-PublicHolidayFR.Tests.ps1" -TestName "Exported variable $IsoCountiesFR"

This expand the variable and change the name of the test that do not exist

image

@daviwil daviwil added Area-Pester Issue-Bug A bug to squash. labels Jun 16, 2017
@daviwil
Copy link
Contributor

daviwil commented Jun 16, 2017

Good catch! I'll get it fixed.

@daviwil daviwil modified the milestones: June 2017, 1.4.0 Jun 16, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Jun 21, 2017
This change causes Pester tests run with the "Run/Debug Tests"
CodeLenses to be launched using single quotes with the `-TestName`
parameter so that variable names in the test name don't get expanded.

Resolves PowerShell#891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Pester Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

2 participants