@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
package/src/core/constants.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
21
|
-
|
|
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 (
|
|
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
|
|