Skip to content

Commit

Permalink
fix hanging run issue (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
connectdotz authored Oct 21, 2022
1 parent 7d5b01c commit 7405af7
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 106 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-jest",
"displayName": "Jest",
"description": "Use Facebook's Jest With Pleasure.",
"version": "5.0.0",
"version": "5.0.1",
"publisher": "Orta",
"engines": {
"vscode": "^1.68.1"
Expand Down
14 changes: 9 additions & 5 deletions src/test-provider/test-item-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,15 @@ export class WorkspaceRoot extends TestItemDataBase {
};
/** return a valid run from process or process-run-cache. return undefined if run is closed. */
private getJestRun = (process: JestProcessInfo): JestTestRun | undefined => {
const run = isJestTestRunRequest(process.request)
? process.request.run
: this.cachedRun.get(process.id);

return run?.isClosed() ? undefined : run;
if (isJestTestRunRequest(process.request) && !process.request.run.isClosed()) {
return process.request.run;
}
const run = this.cachedRun.get(process.id);
if (run?.isClosed()) {
this.cachedRun.delete(process.id);
return;
}
return run;
};

private runLog(type: string): void {
Expand Down
Loading

0 comments on commit 7405af7

Please sign in to comment.