File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export class TestRunManager {
54
54
const key = this . getTestRunKey ( folder ) ;
55
55
const activeRun = this . activeTestRuns . get ( key ) ;
56
56
if ( activeRun ) {
57
+ activeRun . testRun . skipPendingTests ( ) ;
57
58
activeRun . tokenSource . cancel ( ) ;
58
59
}
59
60
}
Original file line number Diff line number Diff line change @@ -309,6 +309,18 @@ export class TestRunProxy {
309
309
this . testRun ?. errored ( test , message , this . recordDuration ? duration : undefined ) ;
310
310
}
311
311
312
+ /**
313
+ * Skip any pending tests.
314
+ * Call this method when a test run is cancelled to mark the pending tests as skipped.
315
+ * Otherwise, pending tests will be marked as failing as we assume they crashed.
316
+ */
317
+ public skipPendingTests ( ) {
318
+ this . runState . pending . forEach ( test => {
319
+ this . skipped ( test ) ;
320
+ } ) ;
321
+ this . runState . pending = [ ] ;
322
+ }
323
+
312
324
public async end ( ) {
313
325
// If the test run never started (typically due to a build error)
314
326
// start it to flush any queued output, and then immediately end it.
You can’t perform that action at this time.
0 commit comments