From 102fb834892b93013ca732b6871aecac0d36e5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Mon, 12 Feb 2024 11:03:07 +0000 Subject: [PATCH] Improve error message on mockStep failure --- src/step-mocker/step-mocker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/step-mocker/step-mocker.ts b/src/step-mocker/step-mocker.ts index 9ef47b5..8d37b37 100644 --- a/src/step-mocker/step-mocker.ts +++ b/src/step-mocker/step-mocker.ts @@ -43,7 +43,9 @@ export class StepMocker { this.updateStep(workflow, jobId, stepIndex, mockStep); } } else { - throw new Error("Could not find step"); + const stepQuery = { ...mockStep }; + delete stepQuery.mockWith; + throw new Error(`Could not find step ${JSON.stringify(stepQuery)} in job ${jobId}\nin ${filePath}`); } } stepsToAdd.forEach(s => this.addStep(workflow, s.jobId, s.stepIndex, s.mockStep));