@argos-ci/util 2.0.0 → 2.1.1-alpha.12
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/browser.d.ts +11 -1
- package/dist/browser.mjs +9 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.mjs +9 -1
- package/package.json +3 -3
package/dist/browser.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ type ScreenshotMetadata = {
|
|
|
12
12
|
titlePath: string[];
|
|
13
13
|
retries?: number;
|
|
14
14
|
retry?: number;
|
|
15
|
+
repeat?: number;
|
|
15
16
|
location?: {
|
|
16
17
|
file: string;
|
|
17
18
|
line: number;
|
|
@@ -30,6 +31,11 @@ type ScreenshotMetadata = {
|
|
|
30
31
|
name: string;
|
|
31
32
|
version: string;
|
|
32
33
|
};
|
|
34
|
+
// Metdata used to pass informations later removed from metadata.
|
|
35
|
+
transient?: {
|
|
36
|
+
threshold?: number;
|
|
37
|
+
baseName?: string;
|
|
38
|
+
};
|
|
33
39
|
};
|
|
34
40
|
/**
|
|
35
41
|
* Get metadata path from screenshot path.
|
|
@@ -41,5 +47,9 @@ declare function getMetadataPath(screenshotPath: string): string;
|
|
|
41
47
|
declare function getScreenshotName(name: string, options?: {
|
|
42
48
|
viewportWidth?: number;
|
|
43
49
|
}): string;
|
|
44
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Validates the threshold value.
|
|
52
|
+
*/
|
|
53
|
+
declare function validateThreshold(threshold: number): void;
|
|
54
|
+
export { getMetadataPath, getScreenshotName, validateThreshold };
|
|
45
55
|
export type { ScreenshotMetadata };
|
package/dist/browser.mjs
CHANGED
|
@@ -16,4 +16,12 @@
|
|
|
16
16
|
return parts.join(" ");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Validates the threshold value.
|
|
21
|
+
*/ function validateThreshold(threshold) {
|
|
22
|
+
if (threshold < 0 || threshold > 1) {
|
|
23
|
+
throw new Error("The threshold must be between 0 and 1.");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { getMetadataPath, getScreenshotName, validateThreshold };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ type ScreenshotMetadata = {
|
|
|
20
20
|
titlePath: string[];
|
|
21
21
|
retries?: number;
|
|
22
22
|
retry?: number;
|
|
23
|
+
repeat?: number;
|
|
23
24
|
location?: {
|
|
24
25
|
file: string;
|
|
25
26
|
line: number;
|
|
@@ -38,6 +39,11 @@ type ScreenshotMetadata = {
|
|
|
38
39
|
name: string;
|
|
39
40
|
version: string;
|
|
40
41
|
};
|
|
42
|
+
// Metdata used to pass informations later removed from metadata.
|
|
43
|
+
transient?: {
|
|
44
|
+
threshold?: number;
|
|
45
|
+
baseName?: string;
|
|
46
|
+
};
|
|
41
47
|
};
|
|
42
48
|
/**
|
|
43
49
|
* Get metadata path from screenshot path.
|
|
@@ -63,4 +69,8 @@ declare function getScreenshotName(name: string, options?: {
|
|
|
63
69
|
* If not found, returns null.
|
|
64
70
|
*/
|
|
65
71
|
declare function getPlaywrightTracePath(screenshotPath: string): Promise<string | null>;
|
|
66
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Validates the threshold value.
|
|
74
|
+
*/
|
|
75
|
+
declare function validateThreshold(threshold: number): void;
|
|
76
|
+
export { getGitRepositoryPath, readVersionFromPackage, ScreenshotMetadata, getMetadataPath, writeMetadata, readMetadata, getScreenshotName, getPlaywrightTracePath, validateThreshold };
|
package/dist/index.mjs
CHANGED
|
@@ -101,4 +101,12 @@ const versionCache = new Map();
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Validates the threshold value.
|
|
106
|
+
*/ function validateThreshold(threshold) {
|
|
107
|
+
if (threshold < 0 || threshold > 1) {
|
|
108
|
+
throw new Error("The threshold must be between 0 and 1.");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export { getGitRepositoryPath, getMetadataPath, getPlaywrightTracePath, getScreenshotName, readMetadata, readVersionFromPackage, validateThreshold, writeMetadata };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/util",
|
|
3
3
|
"description": "Set of utilities used across all Argos SDKs",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1-alpha.12+4b6e8a3",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"build": "rollup -c"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^18.
|
|
37
|
+
"@types/node": "^18.19.44"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "4b6e8a36627d466e65859396ec6cfee717ba7c7b"
|
|
40
40
|
}
|