Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Add debug events for continue
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Aug 20, 2019
1 parent a54ddde commit 9ff9de5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/src/session.spec.ts
Expand Up @@ -9,9 +9,12 @@ import { createClientSession, sleep } from '@jupyterlab/testutils';

import { find } from '@phosphor/algorithm';

import { PromiseDelegate } from '@phosphor/coreutils';

import { DebugProtocol } from 'vscode-debugprotocol';

import { IDebugger } from '../../lib/tokens';

import { DebugSession } from '../../lib/session';

describe('DebugSession', () => {
Expand Down Expand Up @@ -209,8 +212,22 @@ describe('protocol', () => {

describe('#continue', () => {
it('should proceed to the next breakpoint', async () => {
let events: string[] = [];
const eventsFuture = new PromiseDelegate<string[]>();
debugSession.eventMessage.connect((sender, event) => {
events.push(event.event);
// aggregate the next 2 debug events
if (events.length === 2) {
eventsFuture.resolve(events);
}
});

await debugSession.sendRequest('continue', { threadId });

// wait for debug events
const debugEvents = await eventsFuture.promise;
expect(debugEvents).to.deep.equal(['continued', 'stopped']);

const variables = await getVariables();
const i = find(variables, variable => variable.name === 'i');
expect(i).to.exist;
Expand Down

0 comments on commit 9ff9de5

Please sign in to comment.