govgate 0.2.1 → 0.2.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/dist/index.js +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -169,6 +169,16 @@ function loadFileConfig(path) {
|
|
|
169
169
|
}
|
|
170
170
|
return out;
|
|
171
171
|
}
|
|
172
|
+
function loadFileMappings(flags, cwd = process.cwd()) {
|
|
173
|
+
const configPath = findConfigFile(cwd, flags.config);
|
|
174
|
+
const file = configPath ? loadFileConfig(configPath) : {};
|
|
175
|
+
return {
|
|
176
|
+
mappings: file.mappings ?? {},
|
|
177
|
+
suite: flags.suite ?? file.suite,
|
|
178
|
+
environment: flags.env ?? file.defaultEnvironment,
|
|
179
|
+
configPath
|
|
180
|
+
};
|
|
181
|
+
}
|
|
172
182
|
function resolveConfig(flags, cwd = process.cwd()) {
|
|
173
183
|
const configPath = findConfigFile(cwd, flags.config);
|
|
174
184
|
const file = configPath ? loadFileConfig(configPath) : {};
|
|
@@ -488,7 +498,7 @@ program.command("report").description("Parse test result files (JUnit XML), map
|
|
|
488
498
|
};
|
|
489
499
|
const tests = await parseFiles(files, opts.format);
|
|
490
500
|
const config = opts.dryRun ? tryResolveConfig(flags) : resolveConfig(flags);
|
|
491
|
-
const mappings = config?.mappings ?? {};
|
|
501
|
+
const mappings = config?.mappings ?? (opts.dryRun ? loadFileMappings(flags).mappings : {});
|
|
492
502
|
const outcome = mapTestsToCases(tests, mappings);
|
|
493
503
|
console.log(
|
|
494
504
|
`Parsed ${tests.length} test(s) from ${files.join(", ")} \u2014 ${outcome.results.length} case(s) mapped, ${outcome.unmappedTests.length} unmapped test(s)`
|
package/package.json
CHANGED