MCPcopy Create free account
hub / github.com/Snapchat/Valdi / runScript

Method runScript

valdi/vscode_debugger/src/test/test.ts:451–474  ·  view source on GitHub ↗
(
    filename: string,
    options: Partial<INodeLaunchConfiguration> = {},
  )

Source from the content-addressed store, hash-verified

449 }
450
451 async runScript(
452 filename: string,
453 options: Partial<INodeLaunchConfiguration> = {},
454 ): Promise<NodeTestHandle> {
455 await this.initialize;
456 this._launchUrl = path.isAbsolute(filename) ? filename : path.join(testFixturesDir, filename);
457
458 const tmpLogPath = getLogFileForTest(this._testTitlePath);
459 this._root.dap.launch({
460 type: DebugType.Node,
461 request: 'launch',
462 name: 'Test Case',
463 cwd: path.dirname(testFixturesDir),
464 program: this._launchUrl,
465 rootPath: this._workspaceRoot,
466 trace: { logFile: tmpLogPath },
467 outFiles: [`${this._workspaceRoot}/**/*.js`, '!**/node_modules/**'],
468 resolveSourceMapLocations: ['**', '!**/node_modules/**'],
469 __workspaceFolder: this._workspaceRoot,
470 ...options,
471 } as INodeLaunchConfiguration);
472 const result = await new Promise(f => (this._launchCallback = f));
473 return result as NodeTestHandle;
474 }
475
476 /**
477 * Runs a script in a separate workspace (i.e. a different 'remoteRoot')

Callers

nothing calls this directly

Calls 4

getLogFileForTestFunction · 0.90
isAbsoluteMethod · 0.80
launchMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected