From 374509c7b3940188bf2df621ae15d339a1916d66 Mon Sep 17 00:00:00 2001 From: "guillaume.caya" Date: Wed, 30 Oct 2024 17:22:59 -0400 Subject: [PATCH] Maybe fix? --- task/tests/integration/integration-tests.spec.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/task/tests/integration/integration-tests.spec.ts b/task/tests/integration/integration-tests.spec.ts index 0a8b7df..8e8f955 100644 --- a/task/tests/integration/integration-tests.spec.ts +++ b/task/tests/integration/integration-tests.spec.ts @@ -18,19 +18,17 @@ describe('LighthouseV1 suite', function () { ]; for (const testName of testNames) { - it(testName, done => { + it(testName, async () => { const testPath = path.join(__dirname, testName + '.js'); const taskJsonPath = path.join(__dirname, '..', '..', 'src', 'task.json'); const tr = new MockTestRunner(testPath, taskJsonPath); // As of today (2023-03-12), azure-pipelines-task-lib testing framework doesn't support Node 18 // https://github.com/microsoft/azure-pipelines-task-lib/blob/149de35abb4ee930cf512c3d88d9178f277fb3fe/node/mock-test.ts#L156 - tr.run(16); - - assert(tr.invokedToolCount === 1, 'Should have only run lighthouse'); - assert(tr.succeeded, 'Task should have succeeded, stdout: ' + tr.stdout); - - done(); + tr.runAsync(16).then(() => { + assert(tr.invokedToolCount === 1, 'Should have only run lighthouse'); + assert(tr.succeeded, 'Task should have succeeded, stdout: ' + tr.stdout); + }); }); } });