🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@allurereport/core-api

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@allurereport/core-api - npm Package Compare versions

Comparing version
3.0.0-beta.7
to
3.0.0-beta.8
+2
-1
dist/constants.d.ts

@@ -20,2 +20,3 @@ import type { Statistic } from "./aggregate.js";

export declare const emptyStatistic: () => Statistic;
export declare const incrementStatistic: (statistic: Statistic, status: TestStatus) => void;
export declare const incrementStatistic: (statistic: Statistic, status: TestStatus, count?: number) => void;
export declare const mergeStatistic: (statistic: Statistic, additional: Statistic) => void;

@@ -13,5 +13,12 @@ export const statusesList = ["failed", "broken", "passed", "skipped", "unknown"];

export const emptyStatistic = () => ({ total: 0 });
export const incrementStatistic = (statistic, status) => {
statistic[status] = (statistic[status] ?? 0) + 1;
statistic.total++;
export const incrementStatistic = (statistic, status, count = 1) => {
statistic[status] = (statistic[status] ?? 0) + count;
statistic.total += count;
};
export const mergeStatistic = (statistic, additional) => {
statusesList.forEach((status) => {
if (additional[status]) {
incrementStatistic(statistic, status, additional[status]);
}
});
};

@@ -1,2 +0,2 @@

import type { TestStatus } from "./model.js";
import type { TestError, TestStatus } from "./model.js";
export interface HistoryTestResult {

@@ -7,4 +7,3 @@ id: string;

status: TestStatus;
message?: string;
trace?: string;
error?: TestError;
start?: number;

@@ -11,0 +10,0 @@ stop?: number;

@@ -1,2 +0,3 @@

import type { TestError, TestLink } from "./metadata.js";
import type { TestLink } from "./metadata.js";
import type { TestError } from "./model.js";
export interface KnownTestFailure {

@@ -3,0 +4,0 @@ historyId: string;

@@ -1,4 +0,1 @@

import type { TestStatus } from "./model.js";
export interface Location {
}
export interface TestLabel {

@@ -20,11 +17,1 @@ name: string;

}
export interface TestError {
id: string;
message: string;
trace?: string;
status?: TestStatus;
code?: string;
location?: Location;
tags: string[];
expected?: boolean;
}

@@ -10,2 +10,8 @@ import type { TestLabel, TestLink, TestParameter } from "./metadata.js";

}
export interface TestError {
message?: string;
trace?: string;
actual?: string;
expected?: string;
}
export interface TestResult {

@@ -15,4 +21,3 @@ id: string;

status: TestStatus;
message?: string;
trace?: string;
error?: TestError;
testCase?: TestCase;

@@ -50,4 +55,3 @@ fullName?: string;

status: TestStatus;
message?: string;
trace?: string;
error?: TestError;
start?: number;

@@ -64,4 +68,3 @@ stop?: number;

status: TestStatus;
message?: string;
trace?: string;
error?: TestError;
start?: number;

@@ -68,0 +71,0 @@ stop?: number;

@@ -8,3 +8,5 @@ import type { Statistic } from "../aggregate.js";

export declare const nullsLast: <T extends {}>(compare: Comparator<T>) => Comparator<T | undefined>;
export declare const compareBy: <T extends Record<string, any> = {}, P extends keyof T = keyof T>(property: P, compare: Comparator<Value<T, P>>) => Comparator<T>;
export declare const nullsFirst: <T extends {}>(compare: Comparator<T>) => Comparator<T | undefined>;
export declare const nullsDefault: <T extends {}>(compare: Comparator<T>, defaultValue: T) => Comparator<T | undefined>;
export declare const compareBy: <T extends Record<string, any> = {}, P extends keyof T = keyof T>(property: P, compare: Comparator<Value<T, P>>, defaultValue?: T[P]) => Comparator<T>;
export declare const andThen: <T>(comparators: Comparator<T>[]) => Comparator<T>;

@@ -11,0 +13,0 @@ export declare const alphabetically: SortFunction<string | undefined>;

@@ -8,4 +8,13 @@ import { statusesList } from "../constants.js";

};
export const compareBy = (property, compare) => {
export const nullsFirst = (compare) => {
return (a, b) => a === b ? 0 : a === undefined || a === null ? -1 : b === undefined || b === null ? 1 : compare(a, b);
};
export const nullsDefault = (compare, defaultValue) => {
return (a, b) => compare(a ?? defaultValue, b ?? defaultValue);
};
export const compareBy = (property, compare, defaultValue) => {
return nullsLast((a, b) => {
if (defaultValue !== undefined) {
return compare(a[property] ?? defaultValue, b[property] ?? defaultValue);
}
if (property in a && property in b) {

@@ -36,5 +45,5 @@ return compare(a[property], b[property]);

export const byStatistic = () => {
const compares = statusesList.map((status) => compareBy(status, reverse(ordinal())));
const compares = statusesList.map((status) => compareBy(status, reverse(ordinal()), 0));
return nullsLast(andThen(compares));
};
export const byName = () => nullsLast(compareBy("name", alphabetically()));

@@ -1,1 +0,1 @@

export declare const formatDuration: (duration: number | undefined) => string;
export declare const formatDuration: (duration?: number) => string;
{
"name": "@allurereport/core-api",
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"description": "Allure Core API",

@@ -35,3 +35,3 @@ "keywords": [

"@vitest/runner": "^2.1.8",
"allure-vitest": "^3.0.7",
"allure-vitest": "^3.0.9",
"eslint": "^8.57.0",

@@ -38,0 +38,0 @@ "eslint-config-prettier": "^9.1.0",