MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / clearSuiteOrDirectory

Method clearSuiteOrDirectory

src/shared/test/test_model.ts:353–377  ·  view source on GitHub ↗
(suiteOrDirectoryPath: string)

Source from the content-addressed store, hash-verified

351 }
352
353 public clearSuiteOrDirectory(suiteOrDirectoryPath: string): void {
354 // We can't tell if it's a file or directory because it's already been deleted, so just
355 // try both.
356 const nodesToRemove = new Set<TreeNode>();
357 const suite = this.suites.getForPath(suiteOrDirectoryPath);
358 if (suite) {
359 nodesToRemove.add(suite.node);
360 this.suites.deleteForPath(suiteOrDirectoryPath);
361 } else {
362 for (const suitePath of Object.keys(this.suites)) {
363 if (isWithinPath(suitePath, suiteOrDirectoryPath)) {
364 const suite = this.suites.getForPath(suitePath);
365 if (suite)
366 nodesToRemove.add(suite.node);
367 this.suites.deleteForPath(suitePath);
368 }
369 }
370 }
371
372 if (nodesToRemove.size) {
373 for (const node of nodesToRemove) {
374 this.removeNode(node);
375 }
376 }
377 }
378
379 public handleSkippedTestsConfigChange(): void {
380 // Skipped tests affect the total count labels.

Callers 1

performSuiteDiscoveryMethod · 0.80

Calls 5

removeNodeMethod · 0.95
isWithinPathFunction · 0.90
getForPathMethod · 0.80
deleteForPathMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected