diff options
author | Florian Dold <florian@dold.me> | 2023-12-15 12:20:12 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-12-15 12:20:20 +0100 |
commit | b52b260fb74062085a9a280db2775d2e7c18b1a3 (patch) | |
tree | 5922888a1eab6905fcf011ee8e6664421cd02672 /packages/taler-harness/src | |
parent | a30615c2118659e5b928593a800075e5285c65c3 (diff) | |
download | wallet-core-b52b260fb74062085a9a280db2775d2e7c18b1a3.tar.xz |
bump dependencies
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r-- | packages/taler-harness/src/index.ts | 38 |
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", { |