diff --git a/src/test/integration/codeAction.test.ts b/src/test/integration/codeAction.test.ts index 7168ebec2..8d060fe93 100644 --- a/src/test/integration/codeAction.test.ts +++ b/src/test/integration/codeAction.test.ts @@ -29,6 +29,9 @@ suite('code actions', () => { new vscode.CodeAction('Format Document', vscode.CodeActionKind.Source.append('formatAll').append('terraform')), ]; + // wait till the LS is ready to acccept a code action request + await sleep(1000); + for (let index = 0; index < supported.length; index++) { const wanted = supported[index]; const requested = wanted.kind?.value.toString(); @@ -50,3 +53,9 @@ suite('code actions', () => { } }); }); + +function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); +}