k6-cucumber-steps 1.0.8 → 1.0.10

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.
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require("fs");
4
3
  const path = require("path");
5
4
  const { spawn } = require("child_process");
6
5
  require("dotenv").config();
7
-
8
- // Use yargs for better argument parsing
9
6
  const argv = require("yargs")
10
7
  .usage("Usage: $0 run --feature <path> [options]")
11
8
  .option("feature", {
@@ -14,24 +11,19 @@ const argv = require("yargs")
14
11
  type: "string",
15
12
  demandOption: true,
16
13
  })
17
- .option("tags", {
18
- alias: "t",
19
- describe:
20
- "Cucumber tags to filter scenarios (e.g., '@smoke and not @integration')",
21
- type: "string",
22
- })
14
+ .option("tags", { alias: "t", describe: "Cucumber tags", type: "string" })
23
15
  .option("reporter", {
24
16
  alias: "r",
25
- describe: "Generate HTML and JSON reports in the reports directory",
17
+ describe: "Generate reports",
26
18
  type: "boolean",
27
19
  default: false,
28
20
  })
29
21
  .help().argv;
30
22
 
31
23
  const featureFilePath = path.resolve(process.cwd(), argv.feature);
32
- const cucumberCommand = "npx"; // Changed to "npx"
24
+ const cucumberCommand = "npx";
33
25
  const cucumberArgs = [
34
- "cucumber-js", // Now cucumber-js is an argument to npx
26
+ "cucumber-js",
35
27
  featureFilePath,
36
28
  "--require-module",
37
29
  "@babel/register",
@@ -46,15 +38,15 @@ const cucumberArgs = [
46
38
  "summary",
47
39
  ];
48
40
 
49
- if (argv.tags) {
50
- cucumberArgs.push("--tags", argv.tags);
51
- }
52
-
41
+ if (argv.tags) cucumberArgs.push("--tags", argv.tags);
53
42
  if (argv.reporter) {
54
43
  const reportsDir = path.resolve(process.cwd(), "reports");
55
- // Ensure reports directory will be created by cucumber-js if needed
56
- cucumberArgs.push("--format", `json:${reportsDir}/load-results.json`);
57
- cucumberArgs.push("--format", `html:${reportsDir}/load-results.html`);
44
+ cucumberArgs.push(
45
+ "--format",
46
+ `json:${reportsDir}/load-results.json`,
47
+ "--format",
48
+ `html:${reportsDir}/load-results.html`
49
+ );
58
50
  }
59
51
 
60
52
  async function main() {
@@ -63,22 +55,12 @@ async function main() {
63
55
 
64
56
  const cucumberProcess = spawn(cucumberCommand, cucumberArgs, {
65
57
  cwd: process.cwd(),
66
- stdio: "inherit", // Forward stdout and stderr to the console
58
+ stdio: "inherit",
67
59
  });
68
60
 
69
61
  cucumberProcess.on("close", (code) => {
70
- if (code !== 0) {
71
- console.error(`Cucumber process exited with code ${code}`);
72
- process.exit(code);
73
- } else {
74
- console.log(
75
- "Cucumber tests finished successfully. Check k6 output for performance results (if any steps ran k6)."
76
- );
77
- }
62
+ process.exit(code);
78
63
  });
79
64
  }
80
65
 
81
- main().catch((err) => {
82
- console.error("An unexpected error occurred:", err.message);
83
- process.exit(1);
84
- });
66
+ main().catch((err) => console.error(err));
@@ -0,0 +1,2 @@
1
+ // lib/helpers/resolveBody.d.ts
2
+ export function resolveBody(docString: string, env: any): string | any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k6-cucumber-steps",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
File without changes