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

Method assertStoppedLocation

src/test/debug_client_ms.ts:393–418  ·  view source on GitHub ↗
(reason: string, expected: { path?: string | RegExp, line?: number, column?: number, text?: string })

Source from the content-addressed store, hash-verified

391 * The promise will be rejected if a timeout occurs, the assertions fail, or if the 'stackTrace' request fails.
392 */
393 public assertStoppedLocation(reason: string, expected: { path?: string | RegExp, line?: number, column?: number, text?: string }): Promise<DebugProtocol.StackTraceResponse> {
394 return this.waitForStop(
395 reason,
396 'assertStoppedLocation',
397 )
398 .then(event => {
399 assert.equal(event.body.reason, reason);
400 if (expected.text)
401 assert.equal(event.body.text, expected.text);
402 return this.stackTraceRequest({
403 threadId: event.body.threadId
404 });
405 }).then(response => {
406 const frame = response.body.stackFrames[0];
407 if (typeof expected.path === 'string' || expected.path instanceof RegExp) {
408 this.assertPath(frame.source!.path!, expected.path, `stopped location: path mismatch\n expected: ${expected.path}\n actual: ${frame.source!.path!}`);
409 }
410 if (typeof expected.line === 'number') {
411 assert.equal(frame.line, expected.line, `stopped location: line mismatch\n expected: ${expected.line}\n actual: ${frame.line}`);
412 }
413 if (typeof expected.column === 'number') {
414 assert.equal(frame.column, expected.column, `stopped location: column mismatch\n expected: ${expected.column}\n actual: ${frame.column}`);
415 }
416 return response;
417 });
418 }
419
420 private assertPartialLocationsEqual(locA: IPartialLocation, locB: IPartialLocation): void {
421 if (locA.path) {

Callers 6

hitBreakpointMethod · 0.95
dart_test.test.tsFile · 0.80
dart_cli.test.tsFile · 0.80
web.test.tsFile · 0.80

Calls 3

waitForStopMethod · 0.95
stackTraceRequestMethod · 0.95
assertPathMethod · 0.95

Tested by

no test coverage detected