本文整理匯總了TypeScript中vscode-debugadapter-testsupport.DebugClient.setVariableRequest方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DebugClient.setVariableRequest方法的具體用法?TypeScript DebugClient.setVariableRequest怎麽用?TypeScript DebugClient.setVariableRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode-debugadapter-testsupport.DebugClient
的用法示例。
在下文中一共展示了DebugClient.setVariableRequest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should set variables', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 11 ]);
util.evaluate(dc, 'vars()');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let stackTrace = await dc.stackTraceRequest({ threadId: stoppedEvent.body.threadId! });
let frameId = stackTrace.body.stackFrames[0].id;
let scopes = await dc.scopesRequest({ frameId });
let variablesReference = scopes.body.scopes[0].variablesReference;
let variables = await dc.variablesRequest({ variablesReference });
assert.equal(util.findVariable(variables.body.variables, 'num1').value, '0');
let result = await dc.evaluateRequest({ context: 'repl', frameId, expression: 'num1' });
assert.equal(result.body.result, '0');
await dc.setVariableRequest({ variablesReference, name: 'num1', value: '7' });
result = await dc.evaluateRequest({ context: 'repl', frameId, expression: 'num1' });
assert.equal(result.body.result, '7');
});