Skip to content

Commit

Permalink
Fix PowerShell#1100 vscode.startDebug deprecated - can't use for Pest…
Browse files Browse the repository at this point in the history
…er CodeLens (PowerShell#1101)
  • Loading branch information
rkeithhill committed Nov 14, 2017
1 parent f198d98 commit 6068537
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/Tests/PathProcessing.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ $null = New-Item -Path "$PSScriptRoot\foo[1].txt" -Force

Import-Module $PSScriptRoot\..\SampleModule.psd1

$WorkspaceRoot = $pwd
$WorkspaceRoot = Convert-Path $PSScriptRoot/..
Set-Location $WorkspaceRoot

Describe 'Verify Path Processing for Non-existing Paths Allowed Impl' {
It 'Processes non-wildcard absolute path to non-existing file via -Path param' {
Expand Down
4 changes: 3 additions & 1 deletion src/features/PesterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class PesterTestsFeature implements IFeature {
let launchConfig = {
request: "launch",
type: "PowerShell",
name: "PowerShell Launch Pester Tests",
script: "Invoke-Pester",
args: [
`-Script "${uri.fsPath}"`,
Expand All @@ -61,6 +62,7 @@ export class PesterTestsFeature implements IFeature {
utils.getDebugSessionFilePath(),
this.sessionManager.getSessionDetails());

vscode.commands.executeCommand('vscode.startDebug', launchConfig);
// TODO: Update to handle multiple root workspaces.
vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], launchConfig);
}
}

0 comments on commit 6068537

Please sign in to comment.