Merge from vscode 966b87dd4013be1a9c06e2b8334522ec61905cc2 (#4696)

This commit is contained in:
Anthony Dresser
2019-03-26 11:43:38 -07:00
committed by GitHub
parent b1393ae615
commit 0d8ef9583b
268 changed files with 5947 additions and 3422 deletions

View File

@@ -61,16 +61,16 @@ export function setup() {
it('focus stack frames and variables', async function () {
const app = this.app as Application;
await app.workbench.debug.waitForVariableCount(4);
await app.workbench.debug.waitForVariableCount(4, 5);
await app.workbench.debug.focusStackFrame('layer.js', 'looking for layer.js');
await app.workbench.debug.waitForVariableCount(5);
await app.workbench.debug.waitForVariableCount(5, 6);
await app.workbench.debug.focusStackFrame('route.js', 'looking for route.js');
await app.workbench.debug.waitForVariableCount(3);
await app.workbench.debug.waitForVariableCount(3, 4);
await app.workbench.debug.focusStackFrame('index.js', 'looking for index.js');
await app.workbench.debug.waitForVariableCount(4);
await app.workbench.debug.waitForVariableCount(4, 5);
});
it('stepOver, stepIn, stepOut', async function () {

View File

@@ -136,8 +136,9 @@ export class Debug extends Viewlet {
await this.waitForOutput(output => accept(output[output.length - 1] || ''));
}
async waitForVariableCount(count: number): Promise<void> {
await this.code.waitForElements(VARIABLE, false, els => els.length === count);
// Different node versions give different number of variables. As a workaround be more relaxed when checking for variable count
async waitForVariableCount(count: number, alternativeCount: number): Promise<void> {
await this.code.waitForElements(VARIABLE, false, els => els.length === count || els.length === alternativeCount);
}
private async waitForOutput(fn: (output: string[]) => boolean): Promise<string[]> {

View File

@@ -48,7 +48,7 @@ export function setup() {
await app.workbench.search.expandReplace();
await app.workbench.search.setReplaceText('ydob');
await app.workbench.search.replaceFileMatch('app.js');
await app.workbench.search.waitForResultText('16 results in 5 files');
await app.workbench.search.waitForResultText('12 results in 4 files');
await app.workbench.search.searchFor('ydob');
await app.workbench.search.setReplaceText('body');