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

Method getOrCreateSuite

src/shared/test/test_model.ts:291–306  ·  view source on GitHub ↗
(suitePath: string)

Source from the content-addressed store, hash-verified

289 }
290
291 public getOrCreateSuite(suitePath: string): [SuiteData, boolean] {
292 const existingSuite = this.suites.getForPath(suitePath);
293 if (existingSuite)
294 return [existingSuite, false];
295
296 const projectPath = locateBestProjectRoot(suitePath);
297 const parent = projectPath ? this.getOrCreateProjectNode(projectPath) : undefined;
298 const suite = new SuiteData(suitePath, projectPath, parent);
299
300 if (parent) {
301 parent.children.push(suite.node);
302 this.updateNode({ node: parent });
303 }
304 this.suites.setForPath(suitePath, suite);
305 return [suite, true];
306 }
307
308 private getOrCreateProjectNode(projectPath: string): ProjectNode {
309 const existingProject = this.projectNodes.get(projectPath);

Callers 2

suiteDiscoveredMethod · 0.95
suiteStartedMethod · 0.95

Calls 5

updateNodeMethod · 0.95
locateBestProjectRootFunction · 0.90
getForPathMethod · 0.80
setForPathMethod · 0.80

Tested by

no test coverage detected