k6-cucumber-steps 1.2.3 → 1.2.4
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.
- package/bin/k6-cucumber-steps.js +27 -9
- package/package.json +1 -1
package/bin/k6-cucumber-steps.js
CHANGED
|
@@ -94,9 +94,35 @@ program
|
|
|
94
94
|
|
|
95
95
|
// Add other options as needed...
|
|
96
96
|
|
|
97
|
-
const finalCommand = [
|
|
97
|
+
const finalCommand = [
|
|
98
|
+
"npx",
|
|
99
|
+
"cucumber-js",
|
|
100
|
+
...cliParts
|
|
101
|
+
].join(" ");
|
|
102
|
+
|
|
98
103
|
console.log("▶️ Final arguments passed to cucumber-js:", finalCommand);
|
|
99
104
|
|
|
105
|
+
// Collect options to pass as env vars
|
|
106
|
+
const extraEnv = {
|
|
107
|
+
SAVE_K6_SCRIPT: argv.saveK6Script === true || process.env.SAVE_K6_SCRIPT === "true" || cucumberConfig.saveK6Script === true ? "true" : "false",
|
|
108
|
+
K6_CUCUMBER_OVERWRITE: argv.overwrite === true || process.env.K6_CUCUMBER_OVERWRITE === "true" || cucumberConfig.overwrite === true ? "true" : "false",
|
|
109
|
+
CLEAN_REPORTS: argv.cleanReports === true || argv.clean === true || process.env.CLEAN_REPORTS === "true" || cucumberConfig.cleanReports === true ? "true" : "false",
|
|
110
|
+
K6_CUCUMBER_REPORTER: argv.reporter === true || process.env.K6_CUCUMBER_REPORTER === "true" || cucumberConfig.reporter === true ? "true" : "false",
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// Now print environment variables (after extraEnv is defined)
|
|
114
|
+
console.log("▶️ Environment variables passed to cucumber-js:");
|
|
115
|
+
Object.entries(extraEnv).forEach(([key, value]) => {
|
|
116
|
+
console.log(` ${key}=${value}`);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
console.log("▶️ CLI flags passed:");
|
|
120
|
+
Object.entries(argv).forEach(([key, value]) => {
|
|
121
|
+
if (typeof value !== "function" && typeof value !== "undefined") {
|
|
122
|
+
console.log(` --${key}=${value}`);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
100
126
|
// Clean reports directory if requested
|
|
101
127
|
const shouldCleanReports =
|
|
102
128
|
argv.cleanReports ||
|
|
@@ -113,14 +139,6 @@ program
|
|
|
113
139
|
}
|
|
114
140
|
}
|
|
115
141
|
|
|
116
|
-
// Collect options to pass as env vars
|
|
117
|
-
const extraEnv = {
|
|
118
|
-
SAVE_K6_SCRIPT: argv.saveK6Script === true || process.env.SAVE_K6_SCRIPT === "true" || cucumberConfig.saveK6Script === true ? "true" : "false",
|
|
119
|
-
K6_CUCUMBER_OVERWRITE: argv.overwrite === true || process.env.K6_CUCUMBER_OVERWRITE === "true" || cucumberConfig.overwrite === true ? "true" : "false",
|
|
120
|
-
CLEAN_REPORTS: argv.cleanReports === true || argv.clean === true || process.env.CLEAN_REPORTS === "true" || cucumberConfig.cleanReports === true ? "true" : "false",
|
|
121
|
-
K6_CUCUMBER_REPORTER: argv.reporter === true || process.env.K6_CUCUMBER_REPORTER === "true" || cucumberConfig.reporter === true ? "true" : "false",
|
|
122
|
-
};
|
|
123
|
-
|
|
124
142
|
// Now spawn the process
|
|
125
143
|
const cucumberProcess = spawn(
|
|
126
144
|
"npx",
|