Skip to content

Add 'Run/Debug Pester tests' command and file tab menu #1698

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

Merged
merged 6 commits into from
Jan 17, 2019
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
"title": "Create New Project from Plaster Template",
"category": "PowerShell"
},
{
"command": "PowerShell.RunPesterTests",
"title": "Run Pester tests",
"category": "PowerShell"
},
{
"command": "PowerShell.OpenExamplesFolder",
"title": "Open Examples Folder",
Expand Down Expand Up @@ -233,6 +238,12 @@
"group": "2_powershell"
}
],
"editor/title/context": [
{
"when": "resourceExtname == .ps1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work:

"when":  "resourceFilename =~ /\.[Tt]ests\.ps1$/"

Copy link
Contributor Author

@bergmeister bergmeister Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I had to escape the backslash in JSON and then your suggestion worked: "resourceFilename =~ /\\.[Tt]ests\\.ps1$/"
The PR is now ready for review :)

"command": "PowerShell.RunPesterTests"
}
],
"view/title": [
{
"command": "PowerShell.RefreshCommandsExplorer",
Expand Down