(reason: string, expected: { path?: string | RegExp, line?: number, column?: number, text?: string })
| 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) { |
no test coverage detected