Skip to content

Commit

Permalink
copy over to legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Oct 7, 2024
1 parent f271e14 commit 6f8fe3c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/playwrightTestCLI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,23 @@ export class PlaywrightTestCLI {
const reporterServer = new ReporterServer(this._vscode);
const testOptions = await this._options.runHooks.onWillRunTests(this._model.config, true);
try {
const debugEnd = new this._vscode.CancellationTokenSource();
token.onCancellationRequested(() => debugEnd.cancel());

let mainDebugRun: vscodeTypes.DebugSession | undefined;
this._vscode.debug.onDidStartDebugSession(session => {
if (session.name === debugSessionName)
mainDebugRun ??= session;
});
this._vscode.debug.onDidTerminateDebugSession(session => {
// child processes have their own debug sessions,
// but we only want to stop debugging if the user cancels the main session
if (session.id === mainDebugRun?.id)
debugEnd.cancel();
});

token = debugEnd.token;

await this._vscode.debug.startDebugging(undefined, {
type: 'pwa-node',
name: debugSessionName,
Expand Down

0 comments on commit 6f8fe3c

Please sign in to comment.