@dev-blinq/cucumber_client 1.0.1260-dev → 1.0.1261-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -352,17 +352,38 @@ export async function updateFeatureFile({ featureName, scenario, override, proje
|
|
|
352
352
|
if (updatedFeatureFileContent === "error") {
|
|
353
353
|
throw new Error(`Error while parsing feature file: Invalid gherkin`);
|
|
354
354
|
}
|
|
355
|
-
|
|
355
|
+
try {
|
|
356
|
+
updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, {
|
|
357
|
+
...prettierConfig,
|
|
358
|
+
parser: "gherkin",
|
|
359
|
+
});
|
|
360
|
+
} catch (error) {
|
|
361
|
+
console.error("Error formatting feature file content with Prettier:", error);
|
|
362
|
+
}
|
|
356
363
|
writeFileSync(featureFilePath, updatedFeatureFileContent);
|
|
357
364
|
return;
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
let updatedFeatureFileContent = featureFileContent + "\n" + scenarioContent;
|
|
361
|
-
|
|
368
|
+
try {
|
|
369
|
+
updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, {
|
|
370
|
+
...prettierConfig,
|
|
371
|
+
parser: "gherkin",
|
|
372
|
+
});
|
|
373
|
+
} catch (error) {
|
|
374
|
+
console.error("Error formatting feature file content with Prettier:", error);
|
|
375
|
+
}
|
|
362
376
|
writeFileSync(featureFilePath, updatedFeatureFileContent);
|
|
363
377
|
} else {
|
|
364
378
|
let featureFileContent = `Feature: ${featureName}\n${scenarioContent}`;
|
|
365
|
-
|
|
379
|
+
try {
|
|
380
|
+
featureFileContent = await prettier.format(featureFileContent, {
|
|
381
|
+
...prettierConfig,
|
|
382
|
+
parser: "gherkin",
|
|
383
|
+
});
|
|
384
|
+
} catch (error) {
|
|
385
|
+
console.error("Error formatting feature file content with Prettier:", error);
|
|
386
|
+
}
|
|
366
387
|
writeFileSync(featureFilePath, featureFileContent);
|
|
367
388
|
}
|
|
368
389
|
}
|