diff --git a/integration/__tests__/app.tests.ts b/integration/__tests__/app.tests.ts index c9de928d23..ca30015fa1 100644 --- a/integration/__tests__/app.tests.ts +++ b/integration/__tests__/app.tests.ts @@ -96,8 +96,7 @@ describe("Lens integration tests", () => { }); it("ensures helm repos", async () => { - const reposJson = await listHelmRepositories(); - const repos = JSON.parse(reposJson); + const repos = await listHelmRepositories(); if (!repos[0]) { fail("Lens failed to add Bitnami repository"); diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index 407958c4c4..a865280fed 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -28,6 +28,10 @@ export function setup(): Application { }); } +type HelmRepository = { + name: string; + url: string; +}; type AsyncPidGetter = () => Promise; export const promiseExec = util.promisify(exec); @@ -43,12 +47,12 @@ export async function tearDown(app: Application) { } } -export async function listHelmRepositories(retries = 0): Promise { +export async function listHelmRepositories(retries = 0): Promise{ if (retries < 5) { try { const { stdout: reposJson } = await promiseExec("helm repo list -o json"); - return reposJson; + return JSON.parse(reposJson); } catch { await new Promise(r => setTimeout(r, 2000)); // if no repositories, wait for Lens adding bitnami repository @@ -56,5 +60,5 @@ export async function listHelmRepositories(retries = 0): Promise { } } - return "[]"; + return []; }