(text: string, accept: (result: string) => boolean)
| 124 | } |
| 125 | |
| 126 | async waitForReplCommand(text: string, accept: (result: string) => boolean): Promise<void> { |
| 127 | await this.commands.runCommand('Debug: Focus on Debug Console View'); |
| 128 | const selector = !this.code.editContextEnabled ? REPL_FOCUSED_TEXTAREA : REPL_FOCUSED_NATIVE_EDIT_CONTEXT; |
| 129 | await this.code.waitForActiveElement(selector); |
| 130 | await this.code.waitForSetValue(selector, text); |
| 131 | |
| 132 | // Wait for the keys to be picked up by the editor model such that repl evaluates what just got typed |
| 133 | await this.editor.waitForEditorContents('debug:replinput', s => s.indexOf(text) >= 0); |
| 134 | await this.code.dispatchKeybinding('enter', async () => { |
| 135 | await this.code.waitForElements(CONSOLE_EVALUATION_RESULT, false, |
| 136 | elements => !!elements.length && accept(elements[elements.length - 1].textContent)); |
| 137 | }); |
| 138 | } |
| 139 | |
| 140 | // Different node versions give different number of variables. As a workaround be more relaxed when checking for variable count |
| 141 | async waitForVariableCount(count: number, alternativeCount: number): Promise<void> { |
nothing calls this directly
no test coverage detected