当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DebugClient.waitForEvent方法代码示例

本文整理汇总了TypeScript中vscode-debugadapter-testsupport.DebugClient.waitForEvent方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DebugClient.waitForEvent方法的具体用法?TypeScript DebugClient.waitForEvent怎么用?TypeScript DebugClient.waitForEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vscode-debugadapter-testsupport.DebugClient的用法示例。


在下文中一共展示了DebugClient.waitForEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

 it('should not stop on a conditional breakpoint when condition is false', async () => {
     await Promise.all([
         client.launch({program}),
         client.waitForEvent('initialized')
     ]);
     const bp = (await client.setBreakpointsRequest({breakpoints: [{line: 10, condition: '$anInt !== 123'}], source: {path: program}})).body.breakpoints[0];
     assert.equal(bp.verified, true, 'breakpoint verification mismatch: verified');
     assert.equal(bp.line, 10, 'breakpoint verification mismatch: line');
     await Promise.all([
         client.configurationDoneRequest(),
         client.waitForEvent('terminated')
     ]);
 });
开发者ID:VivPat,项目名称:vscode-php-debug,代码行数:13,代码来源:adapter.ts

示例2: beforeEach

 beforeEach(async () => {
     await Promise.all([
         client.launch({program}),
         client.waitForEvent('initialized')
     ]);
     await client.setBreakpointsRequest({source: {path: program}, breakpoints: [{line: 17}]});
     const [, event] = await Promise.all([
         client.configurationDoneRequest(),
         client.waitForEvent('stopped') as Promise<DebugProtocol.StoppedEvent>
     ]);
     const stackFrame = (await client.stackTraceRequest({threadId: event.body.threadId})).body.stackFrames[0];
     const scopes = (await client.scopesRequest({frameId: stackFrame.id})).body.scopes;
     localScope = scopes.find(scope => scope.name === 'Locals');
     superglobalsScope = scopes.find(scope => scope.name === 'Superglobals');
     constantsScope = scopes.find(scope => scope.name === 'User defined constants');
 });
开发者ID:VivPat,项目名称:vscode-php-debug,代码行数:16,代码来源:adapter.ts

示例3: test

		test('should stop on a conditional breakpoint', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'program.js');
			const COND_BREAKPOINT_LINE = 13;
			const COND_BREAKPOINT_COLUMN = 2;

			return Promise.all([

				dc.waitForEvent('initialized').then(event => {
					return dc.setBreakpointsRequest({
						breakpoints: [ { line: COND_BREAKPOINT_LINE, condition: 'i === 3' } ],
						source: { path: PROGRAM }
					});
				}).then(response => {
					const bp = response.body.breakpoints[0];
					assert.equal(bp.verified, true, 'breakpoint verification mismatch: verified');
					assert.equal(bp.line, COND_BREAKPOINT_LINE, 'breakpoint verification mismatch: line');
					assert.equal(bp.column, COND_BREAKPOINT_COLUMN, 'breakpoint verification mismatch: column');
					return dc.configurationDoneRequest();
				}),

				dc.launch({ program: PROGRAM }),

				dc.assertStoppedLocation('breakpoint', { path: PROGRAM, line: COND_BREAKPOINT_LINE } ).then(response => {
					const frame = response.body.stackFrames[0];
					return dc.evaluateRequest({ context: 'watch', frameId: frame.id, expression: 'x' }).then(response => {
						assert.equal(response.body.result, 9, 'x !== 9');
						return response;
					});
				})
			]);
		});
开发者ID:abug,项目名称:vscode-node-debug,代码行数:32,代码来源:adapter.test.ts

示例4: it

 it('should support removing a breakpoint', async () => {
     await Promise.all([client.launch({program}), client.waitForEvent('initialized')]);
     // set two breakpoints
     let breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}, {line: 5}], source: {path: program}})).body.breakpoints;
     assert.lengthOf(breakpoints, 2);
     assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
     assert.isTrue(breakpoints[1].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[1].line, 5, 'breakpoint verification mismatch: line');
     // stop at first
     const [{threadId}] = await Promise.all([
         assertStoppedLocation('breakpoint', program, 3),
         client.configurationDoneRequest()
     ]);
     // remove second
     breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}], source: {path: program}})).body.breakpoints;
     assert.lengthOf(breakpoints, 1);
     assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
     // should run to end
     await Promise.all([
         client.waitForEvent('terminated'),
         client.continueRequest({threadId})
     ]);
 });
开发者ID:Heresiarch88,项目名称:vscode-php-debug,代码行数:25,代码来源:adapter.ts

示例5: test

test('should run program to the end', () => {
    return Promise.all([
        dc.configurationSequence(),
        dc.launch({ program: 'tests/out/debuggee' }),
        dc.waitForEvent('terminated')
    ]);
});
开发者ID:magpier84,项目名称:vscode-lldb,代码行数:7,代码来源:adapter.test.ts

示例6: test

		test('should not stop on an exception', () => {

			return Promise.all<DebugProtocol.ProtocolMessage>([

				dc.waitForEvent('initialized').then(event => {
					return dc.setExceptionBreakpointsRequest({
						filters: [ ]
					});
				}).then(response => {
					return dc.configurationDoneRequest();
				}),

				dc.launch({ program: PROGRAM }),

				dc.waitForEvent('terminated')
			]);
		});
开发者ID:codedebug,项目名称:vscode-node-debug,代码行数:17,代码来源:adapter.test.ts


注:本文中的vscode-debugadapter-testsupport.DebugClient.waitForEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。