@nhonh/qabot 0.3.1 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhonh/qabot",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "AI-powered universal QA automation tool. Import any project, AI analyzes and runs tests across all layers.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.3.1";
1
+ export const VERSION = "0.3.2";
2
2
  export const TOOL_NAME = "qabot";
3
3
 
4
4
  export const PROJECT_TYPES = [
@@ -47,8 +47,11 @@ export class TestExecutor {
47
47
  runner: runner.getDisplayName(),
48
48
  });
49
49
 
50
+ const featureSrc = this.config.features?.[feature]?.src;
51
+ const pattern = feature === "all" ? "" : featureSrc || feature;
52
+
50
53
  const command = runner.buildCommand({
51
- pattern: feature !== "all" ? feature : "",
54
+ pattern,
52
55
  coverage,
53
56
  verbose,
54
57
  env: this.config.environments?.[env],
@@ -17,18 +17,27 @@ export class JestRunner extends BaseRunner {
17
17
  }
18
18
 
19
19
  buildCommand(options = {}) {
20
- if (this.config.command && options.pattern) {
21
- return this.config.command.replace("{pattern}", options.pattern);
20
+ const jsonFile = path.join(tmpdir(), `qabot-jest-${nanoid(8)}.json`);
21
+ this._jsonFile = jsonFile;
22
+
23
+ const pattern = options.pattern || "";
24
+ const jsonArgs = `--json --outputFile="${jsonFile}" --forceExit --detectOpenHandles`;
25
+
26
+ if (this.config.command) {
27
+ let cmd = this.config.command;
28
+ if (cmd.includes("{pattern}")) {
29
+ cmd = cmd.replace("{pattern}", pattern);
30
+ } else if (pattern) {
31
+ const separator = cmd.startsWith("npm") ? " -- " : " ";
32
+ cmd = `${cmd}${separator}--testPathPattern="${pattern}"`;
33
+ }
34
+ return `${cmd} ${jsonArgs}`;
22
35
  }
23
36
 
24
37
  const parts = ["npx", "jest"];
25
- if (options.pattern) parts.push(`--testPathPattern="${options.pattern}"`);
38
+ if (pattern) parts.push(`--testPathPattern="${pattern}"`);
26
39
  if (options.coverage) parts.push("--coverage");
27
-
28
- const jsonFile = path.join(tmpdir(), `qabot-jest-${nanoid(8)}.json`);
29
- parts.push("--json", `--outputFile="${jsonFile}"`);
30
- parts.push("--forceExit", "--detectOpenHandles");
31
- this._jsonFile = jsonFile;
40
+ parts.push(jsonArgs);
32
41
  return parts.join(" ");
33
42
  }
34
43