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); + }); }); } });