comparadise-utils 1.8.11 → 1.8.13
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
CHANGED
|
@@ -21,6 +21,12 @@ function getTestFolderPathFromScripts(rawName) {
|
|
|
21
21
|
if (!relativeTestPath) {
|
|
22
22
|
throw new Error('❌ Could not find matching script in the Cypress DOM to infer the test folder path');
|
|
23
23
|
}
|
|
24
|
+
const currentTestNumber = Cypress.mocha.getRunner().currentRunnable?.order;
|
|
25
|
+
if (!rawName &&
|
|
26
|
+
typeof currentTestNumber === 'number' &&
|
|
27
|
+
currentTestNumber > 1) {
|
|
28
|
+
throw new Error('❌ The rawName argument was not provided to matchScreenshot and is required for test files containing multiple tests!');
|
|
29
|
+
}
|
|
24
30
|
const testName = relativeTestPath.substring(relativeTestPath.lastIndexOf('/') + 1, relativeTestPath.lastIndexOf(SUFFIX_TEST_IDENTIFIER));
|
|
25
31
|
const name = rawName || testName;
|
|
26
32
|
const screenshotsFolder = `${SCREENSHOTS_FOLDER_NAME}/${relativeTestPath.substring(0, relativeTestPath.lastIndexOf(testName))}${name}`;
|
package/package.json
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/pixelmatch": "5.2.4",
|
|
25
|
-
"@types/pngjs": "6.0.
|
|
26
|
-
"cypress": "
|
|
25
|
+
"@types/pngjs": "6.0.2",
|
|
26
|
+
"cypress": "13.2.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"cypress": ">=12"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dist",
|
|
33
33
|
"types"
|
|
34
34
|
],
|
|
35
|
-
"version": "1.8.
|
|
35
|
+
"version": "1.8.13",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc && tsc --project tsconfig.types.json",
|
|
38
38
|
"bump-version": "pnpm version $NEW_VERSION",
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
/// <reference types="cypress" />
|
|
2
|
+
/// <reference types="cypress" />
|
|
2
3
|
export type MatchScreenshotArgs = {
|
|
3
4
|
rawName?: string;
|
|
4
5
|
options?: Partial<Cypress.ScreenshotOptions>;
|
|
5
6
|
};
|
|
6
7
|
export declare function matchScreenshot(subject: Cypress.JQueryWithSelector | Window | Document | void, args?: MatchScreenshotArgs): void;
|
|
8
|
+
interface ExtendedCurrentRunnable extends Mocha.Runnable {
|
|
9
|
+
currentRunnable?: {
|
|
10
|
+
order?: unknown;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
namespace Cypress {
|
|
15
|
+
interface Cypress {
|
|
16
|
+
mocha: {
|
|
17
|
+
getRunner: () => ExtendedCurrentRunnable;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {};
|