Skip to content

Commit 6f4af35

Browse files
committed
Fix #1100 vscode.startDebug deprecated - can't use for Pester CodeLens
1 parent f198d98 commit 6f4af35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/Tests/PathProcessing.Tests.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ $null = New-Item -Path "$PSScriptRoot\foo[1].txt" -Force
1212

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

15-
$WorkspaceRoot = $pwd
15+
$WorkspaceRoot = Convert-Path $PSScriptRoot/..
16+
Set-Location $WorkspaceRoot
1617

1718
Describe 'Verify Path Processing for Non-existing Paths Allowed Impl' {
1819
It 'Processes non-wildcard absolute path to non-existing file via -Path param' {

src/features/PesterTests.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class PesterTestsFeature implements IFeature {
3737
let launchConfig = {
3838
request: "launch",
3939
type: "PowerShell",
40+
name: "PowerShell Launch Pester Tests",
4041
script: "Invoke-Pester",
4142
args: [
4243
`-Script "${uri.fsPath}"`,
@@ -61,6 +62,7 @@ export class PesterTestsFeature implements IFeature {
6162
utils.getDebugSessionFilePath(),
6263
this.sessionManager.getSessionDetails());
6364

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

0 commit comments

Comments
 (0)