Skip to content

Commit 09b6faf

Browse files
committed
Improve completion tests.
1 parent ebffc65 commit 09b6faf

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • rascal-vscode-extension/src/test/vscode-suite

rascal-vscode-extension/src/test/vscode-suite/utils.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,10 @@ export function printRascalOutputOnFailure(channel: 'Language Parametric Rascal'
556556
}
557557

558558
export async function expectCompletions(driver: WebDriver, editor: TextEditor, expectedLabels: string[]) {
559-
const completions = await driver.wait(async () => {
559+
await driver.wait(async () => {
560560
const completionMenu = new ContentAssist(editor);
561-
return await ignoreFails(completionMenu.getItems());
562-
}, Delays.fast, "Completion items not found");
563-
564-
expect(completions).to.have.length(expectedLabels.length);
565-
const labels: string[] = await Promise.all(completions!.map(c => c.getLabel()));
566-
expect(labels).deep.equal(expectedLabels);
561+
const completions = await ignoreFails(completionMenu.getItems());
562+
const labels: string[] = await Promise.all(completions!.map(c => c.getLabel()));
563+
return labels === expectedLabels;
564+
}, Delays.fast, `Completion items do not equal ${expectedLabels}`);
567565
}

0 commit comments

Comments
 (0)