aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/index.ts')
-rw-r--r--packages/taler-harness/src/index.ts38
1 files changed, 6 insertions, 32 deletions
diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts
index ff52fc30f..7234f84d0 100644
--- a/packages/taler-harness/src/index.ts
+++ b/packages/taler-harness/src/index.ts
@@ -657,38 +657,12 @@ deploymentCli
process.exit(2);
});
-
-type TestResult = { testName: string, caseName: string, result: "skiped" | "ok" | "fail", error?: any }
-
-async function getTestSummary<T extends object>(filter: string | undefined, ...apis: Array<TestForApi<T>>) {
- const regex = !filter ? undefined : new RegExp(filter)
- const apiState = await Promise.all(apis.flatMap(api => Object.entries(api).flatMap(([testName, casesMap]) => {
- return Object.entries(casesMap).map(async ([caseName, caseFunc]): Promise<TestResult> => {
- if (!caseFunc) {
- return { testName, caseName, result: "skiped" as const }
- }
- if (regex && !regex.test(`${testName}:${caseName}`)) {
- return { testName, caseName, result: "skiped" as const }
- }
- return caseFunc()
- .then(r => ({ testName, caseName, result: "ok" as const }))
- .catch(error => ({ testName, caseName, result: "fail" as const, error }))
- })
- })))
-
- return apiState.reduce((prev, testResult) => {
- if (testResult.result === "ok") {
- prev.ok.push(testResult)
- }
- if (testResult.result === "skiped") {
- prev.skiped.push(testResult)
- }
- if (testResult.result === "fail") {
- prev.fail.push(testResult)
- }
- return prev
- }, { "ok": [] as TestResult[], "skiped": [] as TestResult[], "fail": [] as TestResult[] })
-}
+type TestResult = {
+ testName: string;
+ caseName: string;
+ result: "skiped" | "ok" | "fail";
+ error?: any;
+};
deploymentCli
.subcommand("coincfg", "gen-coin-config", {