@allurereport/core-api 3.17.0 → 3.18.0
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/config.d.ts +2 -1
- package/dist/config.js +7 -1
- package/dist/history.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -0
- package/dist/model.d.ts +1 -0
- package/dist/utils/successRate.d.ts +3 -0
- package/dist/utils/successRate.js +6 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type DefaultLabelsConfig = Record<string, string | string[]>;
|
|
2
|
+
export declare const parseIntegerConfigValue: (value: unknown, minValue?: number) => number | undefined;
|
|
2
3
|
export type AllureServiceConfig = {
|
|
3
4
|
accessToken?: string;
|
|
4
5
|
private?: boolean;
|
|
@@ -6,4 +7,4 @@ export type AllureServiceConfig = {
|
|
|
6
7
|
uploadMaxAttempts?: number;
|
|
7
8
|
uploadMaxSimultaneousFailures?: number;
|
|
8
9
|
};
|
|
9
|
-
export type ResolvedAllureServiceConfig = AllureServiceConfig & Required<Pick<AllureServiceConfig, "
|
|
10
|
+
export type ResolvedAllureServiceConfig = AllureServiceConfig & Required<Pick<AllureServiceConfig, "uploadMaxAttempts" | "uploadMaxSimultaneousFailures">>;
|
package/dist/config.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const parseIntegerConfigValue = (value, minValue) => {
|
|
2
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
3
|
+
return undefined;
|
|
4
|
+
}
|
|
5
|
+
const normalized = Math.floor(value);
|
|
6
|
+
return minValue === undefined || normalized >= minValue ? normalized : undefined;
|
|
7
|
+
};
|
package/dist/history.d.ts
CHANGED
|
@@ -24,10 +24,12 @@ export interface HistoryDataPoint {
|
|
|
24
24
|
metrics: Record<string, number>;
|
|
25
25
|
url: string;
|
|
26
26
|
}
|
|
27
|
+
export type HistoryTestResultUrlResolver = (historyUrl: string, pluginId: string, historicalResultId: string) => string;
|
|
27
28
|
export interface AllureHistory {
|
|
28
29
|
readHistory(params?: {
|
|
29
30
|
repo?: string;
|
|
30
31
|
branch?: string;
|
|
31
32
|
}): Promise<HistoryDataPoint[]>;
|
|
32
33
|
appendHistory(history: HistoryDataPoint): Promise<void>;
|
|
34
|
+
resolveTestResultUrl?: HistoryTestResultUrlResolver;
|
|
33
35
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from "./metrics.js";
|
|
|
10
10
|
export type * from "./model.js";
|
|
11
11
|
export type * from "./testCase.js";
|
|
12
12
|
export type * from "./testPlan.js";
|
|
13
|
-
export
|
|
13
|
+
export * from "./config.js";
|
|
14
14
|
export * from "./static.js";
|
|
15
15
|
export * from "./categories.js";
|
|
16
16
|
export * from "./utils/step.js";
|
|
@@ -22,6 +22,7 @@ export * from "./utils/label.js";
|
|
|
22
22
|
export * from "./utils/parameter.js";
|
|
23
23
|
export * from "./utils/testplan.js";
|
|
24
24
|
export * from "./utils/status.js";
|
|
25
|
+
export * from "./utils/successRate.js";
|
|
25
26
|
export * from "./utils/environment.js";
|
|
26
27
|
export * from "./utils/history.js";
|
|
27
28
|
export * from "./utils/strings.js";
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./constants.js";
|
|
|
2
2
|
export * from "./ci.js";
|
|
3
3
|
export * from "./gitFlow.js";
|
|
4
4
|
export * from "./metrics.js";
|
|
5
|
+
export * from "./config.js";
|
|
5
6
|
export * from "./static.js";
|
|
6
7
|
export * from "./categories.js";
|
|
7
8
|
export * from "./utils/step.js";
|
|
@@ -12,6 +13,7 @@ export * from "./utils/label.js";
|
|
|
12
13
|
export * from "./utils/parameter.js";
|
|
13
14
|
export * from "./utils/testplan.js";
|
|
14
15
|
export * from "./utils/status.js";
|
|
16
|
+
export * from "./utils/successRate.js";
|
|
15
17
|
export * from "./utils/environment.js";
|
|
16
18
|
export * from "./utils/history.js";
|
|
17
19
|
export * from "./utils/strings.js";
|
package/dist/model.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { includedInSuccessRate } from "../constants.js";
|
|
2
|
+
export const getSuccessRateTotal = (statistic) => Array.from(includedInSuccessRate).reduce((total, status) => total + (statistic[status] ?? 0), 0);
|
|
3
|
+
export const getSuccessRate = (statistic) => {
|
|
4
|
+
const total = getSuccessRateTotal(statistic);
|
|
5
|
+
return total > 0 ? (statistic.passed ?? 0) / total : 0;
|
|
6
|
+
};
|