@dev-blinq/cucumber_client 1.0.1260-dev → 1.0.1262-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,41 @@ 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
- updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, prettierConfig);
355
+ try {
356
+ updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, {
357
+ ...prettierConfig,
358
+ parser: "gherkin",
359
+ plugins: ["prettier-plugin-gherkin"],
360
+ });
361
+ } catch (error) {
362
+ console.error("Error formatting feature file content with Prettier:", error);
363
+ }
356
364
  writeFileSync(featureFilePath, updatedFeatureFileContent);
357
365
  return;
358
366
  }
359
367
  }
360
368
  let updatedFeatureFileContent = featureFileContent + "\n" + scenarioContent;
361
- updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, prettierConfig);
369
+ try {
370
+ updatedFeatureFileContent = await prettier.format(updatedFeatureFileContent, {
371
+ ...prettierConfig,
372
+ parser: "gherkin",
373
+ plugins: ["prettier-plugin-gherkin"],
374
+ });
375
+ } catch (error) {
376
+ console.error("Error formatting feature file content with Prettier:", error);
377
+ }
362
378
  writeFileSync(featureFilePath, updatedFeatureFileContent);
363
379
  } else {
364
380
  let featureFileContent = `Feature: ${featureName}\n${scenarioContent}`;
365
- featureFileContent = await prettier.format(featureFileContent, prettierConfig);
381
+ try {
382
+ featureFileContent = await prettier.format(featureFileContent, {
383
+ ...prettierConfig,
384
+ parser: "gherkin",
385
+ plugins: ["prettier-plugin-gherkin"],
386
+ });
387
+ } catch (error) {
388
+ console.error("Error formatting feature file content with Prettier:", error);
389
+ }
366
390
  writeFileSync(featureFilePath, featureFileContent);
367
391
  }
368
392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1260-dev",
3
+ "version": "1.0.1262-dev",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",