@empiricalrun/test-gen 0.10.2 → 0.10.3
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/CHANGELOG.md +6 -0
- package/dist/bin/index.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/bin/index.js
CHANGED
|
@@ -17,6 +17,7 @@ dotenv_1.default.config({
|
|
|
17
17
|
});
|
|
18
18
|
const logger = new logger_1.CustomLogger();
|
|
19
19
|
async function runAgent(sourceFile, isUpdate, testGenConfigs) {
|
|
20
|
+
const generatedTestScenarios = [];
|
|
20
21
|
const compatibleWithBrowsing = !sourceFile.endsWith(".yaml") &&
|
|
21
22
|
!sourceFile.startsWith("https://docs.google.com/spreadsheets") &&
|
|
22
23
|
!isUpdate;
|
|
@@ -29,14 +30,14 @@ async function runAgent(sourceFile, isUpdate, testGenConfigs) {
|
|
|
29
30
|
else {
|
|
30
31
|
fileForBrowsingAgent = testGenConfig.specPath;
|
|
31
32
|
await (0, utils_1.prepareFileForBrowsingAgent)(testGenConfig);
|
|
33
|
+
generatedTestScenarios.push(...testGenConfig.scenarios);
|
|
32
34
|
}
|
|
33
35
|
if (fileForBrowsingAgent) {
|
|
34
36
|
logger.success("Generating tests using browsing agent");
|
|
35
37
|
await (0, run_1.generateTestsUsingBrowsingAgent)(fileForBrowsingAgent);
|
|
36
|
-
|
|
38
|
+
return generatedTestScenarios;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
const generatedTestScenarios = [];
|
|
40
41
|
for (const testGenConfig of testGenConfigs) {
|
|
41
42
|
const { specPath, scenarios } = testGenConfig;
|
|
42
43
|
if (!fs_extra_1.default.existsSync(specPath)) {
|
|
@@ -82,6 +83,6 @@ async function parseArgs() {
|
|
|
82
83
|
}
|
|
83
84
|
const { sourceFile, testGenConfigs, isUpdate } = await parseArgs();
|
|
84
85
|
const generated = await runAgent(sourceFile, isUpdate, testGenConfigs);
|
|
85
|
-
// TODO: make this work with browsing agent
|
|
86
86
|
await (0, ci_1.reportOnCI)(generated);
|
|
87
|
+
process.exit(0);
|
|
87
88
|
})();
|