@cappa/core 0.1.2 → 0.2.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/.turbo/turbo-build.log +13 -19
- package/.turbo/turbo-test.log +53 -0
- package/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/index.d.mts +190 -38
- package/dist/index.d.ts +190 -38
- package/dist/index.js +430 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +430 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -12
- package/src/compare.test.ts +9 -4
- package/src/compare.ts +76 -23
- package/src/filesystem.test.ts +83 -0
- package/src/filesystem.ts +202 -0
- package/src/index.ts +23 -2
- package/src/plugin.ts +26 -3
- package/src/screenshot.test.ts +40 -0
- package/src/screenshot.ts +425 -119
- package/src/types.ts +23 -1
package/src/types.ts
CHANGED
|
@@ -66,6 +66,14 @@ export type UserConfig = {
|
|
|
66
66
|
* Configuration for the comparison of images
|
|
67
67
|
*/
|
|
68
68
|
diff?: DiffConfig;
|
|
69
|
+
/**
|
|
70
|
+
* The number of times to retry a screenshot if it fails
|
|
71
|
+
*/
|
|
72
|
+
retries?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The number of parallel browser contexts to use for taking screenshots
|
|
75
|
+
*/
|
|
76
|
+
concurrency?: number;
|
|
69
77
|
/**
|
|
70
78
|
* An array of Cappa plugins used for generation.
|
|
71
79
|
* Each plugin may have additional configurable options (defined within the plugin itself).
|
|
@@ -73,12 +81,26 @@ export type UserConfig = {
|
|
|
73
81
|
plugins?: Array<Plugin | PluginDef>;
|
|
74
82
|
};
|
|
75
83
|
|
|
76
|
-
export type
|
|
84
|
+
export type Viewport = { width: number; height: number };
|
|
85
|
+
|
|
86
|
+
export type ScreenshotSettings = {
|
|
77
87
|
fullPage?: boolean;
|
|
78
88
|
delay?: number;
|
|
79
89
|
skip?: boolean;
|
|
80
90
|
mask?: Locator[];
|
|
81
91
|
omitBackground?: boolean;
|
|
92
|
+
viewport?: Viewport;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type ScreenshotVariant = {
|
|
96
|
+
id: string;
|
|
97
|
+
label?: string;
|
|
98
|
+
filename?: string;
|
|
99
|
+
options?: ScreenshotSettings;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type ScreenshotOptions = ScreenshotSettings & {
|
|
103
|
+
variants?: ScreenshotVariant[];
|
|
82
104
|
};
|
|
83
105
|
|
|
84
106
|
export interface Screenshot {
|