Repository: restqa/restqa (js)

Issue:
🚀 [FEATURE]: Change Feature name of generated scenario
### 👀 Background

During the first run, RestQA is initializing the project.

### ✌️ What is the actual behavior?

During the initialization RestQA will generate a Test scenario of `curl localhost:{port}`

### 🕵️‍♀️ How to reproduce the current behavior?

1. go in the folder example/technologies/express
2. delete the folder `tests`
3. Delete the file `.restqa.yml`
4. run the command `npm test`


### 🤞 What is the expected behavior?

Currently the file `tests/local/get.feature` is generated with the 
* Feature name : Welcome to the RestQA community  
* Scenario name: Initial scenario 

We should propose a standard format.

### 😎 Proposed solution.

Let's use the following:
* Feature name : GET /
* Scenario name: Default endpoint

### 🙏 Would you be willing to submit a PR?

Yes

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Pull request description:
feat: change the feature name of the initial scenario generated
## Change description

> Let put a friendly name for the initial scenario generated.

## Type of change
- [ ] Bug fix (fixes an issue)
- [X] New feature (adds functionality)

## Related issues

Fix #329 

## Checklists

### Development

- [x] Lint rules pass locally
- [x] Application changes have been tested thoroughly
- [x] Automated tests covering modified code pass

### Security

- [x] Security impact of change has been considered
- [x] Code follows project security practices and guidelines

### Code review 

- [x] Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary
- [x] Changes have been reviewed by at least one other contributor
- [x] Pull request linked to issue tracker where applicable



Patch:
diff --git a/packages/cli/src/core/initialize.js b/packages/cli/src/core/initialize.js
index 4c6a2d1..c972a79 100644
--- a/packages/cli/src/core/initialize.js
+++ b/packages/cli/src/core/initialize.js
@@ -148,9 +148,9 @@ initialize.generate = async function (options) {
     createRecursiveFolder(output, folder);
 
     const content = [
-      "Feature: Welcome to the RestQA community",
+      "Feature: GET /",
       "",
-      "Scenario: Initial scenario",
+      "Scenario: Initial API (generated)",
       response
     ];
 
diff --git a/packages/cli/src/formatters/export-formatter.js b/packages/cli/src/formatters/export-formatter.js
index 69314c7..0b4f80b 100644
--- a/packages/cli/src/formatters/export-formatter.js
+++ b/packages/cli/src/formatters/export-formatter.js
@@ -1,5 +1,5 @@
 const Welcome = require("../utils/welcome");
-const Pkg = require("../../package.json");
+const {getPackageJson} = require("../utils/fs");
 const path = require("path");
 const {getFormatter} = require("@restqa/cucumber-export");
 const Report = require("@restqa/report-ui");
@@ -83,13 +83,14 @@ options.customExporters = {
 };
 
 function getDataOutput(RESTQA_RESULT) {
-  let RESTQA_SPECIFICATION,
-    RESTQA_INTEGRATION,
-    RESTQA_PERFORMANCE,
-    RESTQA_COLLECTION,
-    RESTQA_HTTP_MOCKS,
-    RESTQA_COVERAGE,
-    RESTQA_CONTRIBUTORS;
+  let RESTQA_SPECIFICATION;
+  let RESTQA_INTEGRATION;
+  let RESTQA_PERFORMANCE;
+  let RESTQA_COLLECTION;
+  let RESTQA_HTTP_MOCKS;
+  let RESTQA_COVERAGE;
+  let RESTQA_VERSION = "0.0.0";
+  let RESTQA_CONTRIBUTORS;
 
   if (global.restqa && global.restqa.specification) {
     RESTQA_SPECIFICATION = global.restqa.specification;
@@ -115,6 +116,11 @@ function getDataOutput(RESTQA_RESULT) {
     RESTQA_COVERAGE = global.restqa.coverage.filename;
   }
 
+  const pkg = getPackageJson(path.join(__dirname, "..", "..", "..")); // from the dist/src/formatters folder...
+  if (pkg) {
+    RESTQA_VERSION = pkg.version;
+  }
+
   return {
     RESTQA_FOLDER: process.cwd(),
     RESTQA_RESULT,
@@ -126,7 +132,7 @@ function getDataOutput(RESTQA_RESULT) {
     RESTQA_CONFIG: config,
     RESTQA_HTTP_MOCKS,
     RESTQA_COVERAGE,
-    RESTQA_VERSION: Pkg.version
+    RESTQA_VERSION
   };
 }
 


Test patch:
diff --git a/packages/cli/src/core/initialize.test.js b/packages/cli/src/core/initialize.test.js
index 61d5391..fd10a85 100644
--- a/packages/cli/src/core/initialize.test.js
+++ b/packages/cli/src/core/initialize.test.js
@@ -209,9 +209,9 @@ describe("#Cli - Initialize", () => {
           .readFileSync(filenameWelcome)
           .toString("utf-8");
         const expectedWelcomeFeature = `
-Feature: Welcome to the RestQA community
+Feature: GET /
 
-Scenario: Initial scenario
+Scenario: Initial API (generated)
 Given I have an example`;
 
         expect(contentWelcome.trim()).toEqual(expectedWelcomeFeature.trim());
@@ -289,9 +289,9 @@ Given I have an example`;
           .readFileSync(filenameWelcome)
           .toString("utf-8");
         const expectedWelcomeFeature = `
-Feature: Welcome to the RestQA community
+Feature: GET /
 
-Scenario: Initial scenario
+Scenario: Initial API (generated)
 Given I have an example`;
 
         expect(contentWelcome.trim()).toEqual(expectedWelcomeFeature.trim());