comparadise-utils 0.0.12 → 0.0.14
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/match-screenshot.js +4 -2
- package/dist/screenshots.d.ts +1 -1
- package/dist/screenshots.js +1 -0
- package/package.json +1 -1
package/dist/match-screenshot.js
CHANGED
|
@@ -43,7 +43,7 @@ function verifyImages() {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
function matchScreenshot(subject, args) {
|
|
46
|
-
const { rawName, options = {} } = args
|
|
46
|
+
const { rawName, options = {} } = args || {};
|
|
47
47
|
// Set up screen
|
|
48
48
|
forceFont();
|
|
49
49
|
// Making sure each image is visible before taking screenshots
|
|
@@ -58,7 +58,7 @@ function matchScreenshot(subject, args) {
|
|
|
58
58
|
cy.task('createNewScreenshot', screenshotsFolder).then(() => {
|
|
59
59
|
cy.task('log', `✅ A new base image was created for ${name}. Create this as a new base image via Comparadise!`);
|
|
60
60
|
});
|
|
61
|
-
return;
|
|
61
|
+
return null;
|
|
62
62
|
}
|
|
63
63
|
cy.task('compareScreenshots', screenshotsFolder).then(diffPixels => {
|
|
64
64
|
if (diffPixels === 0) {
|
|
@@ -67,7 +67,9 @@ function matchScreenshot(subject, args) {
|
|
|
67
67
|
else {
|
|
68
68
|
cy.task('log', `❌ Actual image of ${name} differed by ${diffPixels} pixels.`);
|
|
69
69
|
}
|
|
70
|
+
return null;
|
|
70
71
|
});
|
|
72
|
+
return null;
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
Cypress.Commands.add('matchScreenshot', { prevSubject: ['optional', 'element', 'window', 'document'] }, matchScreenshot);
|
package/dist/screenshots.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @returns true if path/base.png exists, false if not.
|
|
6
6
|
*/
|
|
7
7
|
export declare function baseExists(path: string): boolean;
|
|
8
|
-
export declare function createNewScreenshot(screenshotFolder: string):
|
|
8
|
+
export declare function createNewScreenshot(screenshotFolder: string): null;
|
|
9
9
|
/**
|
|
10
10
|
* Runs a visual regression test.
|
|
11
11
|
* @param screenshotFolder - Full screenshots folder where the base/new/diff
|
package/dist/screenshots.js
CHANGED
package/package.json
CHANGED