happo 6.1.0 → 6.1.2
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/main.js +3 -3
- package/dist/browser/main.js.map +1 -1
- package/dist/cli/cancelJob-BABT3J5D.js +41 -0
- package/dist/cli/cancelJob-BABT3J5D.js.map +7 -0
- package/dist/cli/{chunk-6WOLMTD3.js → chunk-4LQERNTY.js} +3 -3
- package/dist/cli/{chunk-6WOLMTD3.js.map → chunk-4LQERNTY.js.map} +1 -1
- package/dist/cli/{chunk-2N7DDGFD.js → chunk-E53R7YRV.js} +2 -2
- package/dist/cli/{chunk-CJYS7OH2.js → chunk-L3UG4JZC.js} +3 -2
- package/dist/cli/{chunk-L75P3SD7.js → chunk-YG4S4YID.js} +5 -2
- package/dist/cli/chunk-YG4S4YID.js.map +7 -0
- package/dist/cli/createAsyncComparison-EZUGDZVH.js +10 -0
- package/dist/cli/{createAsyncReport-QM3S5HYH.js → createAsyncReport-GGCK4FPX.js} +4 -4
- package/dist/cli/main.js +36 -22
- package/dist/cli/main.js.map +3 -3
- package/dist/cli/package-6SDJT36G.js +7 -0
- package/dist/cli/{prepareSnapRequests-7H6SFFKT.js → prepareSnapRequests-JKQSPWEU.js} +4 -4
- package/dist/cli/{startJob-BT5H6AZS.js → startJob-6HNN4QIJ.js} +4 -4
- package/dist/cli/{wrapper-XGGHYT3I.js → wrapper-7ZOY6B5Z.js} +5 -5
- package/dist/config/loadConfig.d.ts.map +1 -1
- package/dist/cypress/index.js +3 -3
- package/dist/cypress/index.js.map +1 -1
- package/dist/cypress/task.js +25 -9
- package/dist/cypress/task.js.map +3 -3
- package/dist/network/cancelJob.d.ts +1 -1
- package/dist/network/cancelJob.d.ts.map +1 -1
- package/dist/network/makeHappoAPIRequest.d.ts +1 -1
- package/dist/network/makeHappoAPIRequest.d.ts.map +1 -1
- package/dist/playwright/index.js +27 -11
- package/dist/playwright/index.js.map +3 -3
- package/package.json +2 -2
- package/dist/cli/cancelJob-UUJ3U2WI.js +0 -28
- package/dist/cli/cancelJob-UUJ3U2WI.js.map +0 -7
- package/dist/cli/chunk-L75P3SD7.js.map +0 -7
- package/dist/cli/createAsyncComparison-JZL5FR2R.js +0 -10
- package/dist/cli/package-LIJK2K32.js +0 -7
- /package/dist/cli/{chunk-2N7DDGFD.js.map → chunk-E53R7YRV.js.map} +0 -0
- /package/dist/cli/{chunk-CJYS7OH2.js.map → chunk-L3UG4JZC.js.map} +0 -0
- /package/dist/cli/{createAsyncComparison-JZL5FR2R.js.map → createAsyncComparison-EZUGDZVH.js.map} +0 -0
- /package/dist/cli/{createAsyncReport-QM3S5HYH.js.map → createAsyncReport-GGCK4FPX.js.map} +0 -0
- /package/dist/cli/{package-LIJK2K32.js.map → package-6SDJT36G.js.map} +0 -0
- /package/dist/cli/{prepareSnapRequests-7H6SFFKT.js.map → prepareSnapRequests-JKQSPWEU.js.map} +0 -0
- /package/dist/cli/{startJob-BT5H6AZS.js.map → startJob-6HNN4QIJ.js.map} +0 -0
- /package/dist/cli/{wrapper-XGGHYT3I.js.map → wrapper-7ZOY6B5Z.js.map} +0 -0
package/dist/playwright/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/playwright/index.ts
|
|
2
2
|
import fs5 from "node:fs";
|
|
3
|
-
import
|
|
3
|
+
import path3 from "node:path";
|
|
4
4
|
import { test as base } from "@playwright/test";
|
|
5
5
|
|
|
6
6
|
// src/e2e/controller.ts
|
|
@@ -9,6 +9,7 @@ import limitConcur from "limit-concur";
|
|
|
9
9
|
|
|
10
10
|
// src/config/loadConfig.ts
|
|
11
11
|
import fs from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
12
13
|
import { any as findAny } from "empathic/find";
|
|
13
14
|
|
|
14
15
|
// src/network/fetchWithRetry.ts
|
|
@@ -17,7 +18,7 @@ import asyncRetry from "async-retry";
|
|
|
17
18
|
// package.json
|
|
18
19
|
var package_default = {
|
|
19
20
|
name: "happo",
|
|
20
|
-
version: "6.1.
|
|
21
|
+
version: "6.1.2",
|
|
21
22
|
description: "Catch unexpected visual and accessibility changes and UI bugs",
|
|
22
23
|
license: "MIT",
|
|
23
24
|
repository: {
|
|
@@ -193,7 +194,7 @@ var package_default = {
|
|
|
193
194
|
"vrt"
|
|
194
195
|
],
|
|
195
196
|
engines: {
|
|
196
|
-
node: ">=
|
|
197
|
+
node: "^22.18.0 || ^23.6.0 || >=24.0.0"
|
|
197
198
|
}
|
|
198
199
|
};
|
|
199
200
|
|
|
@@ -524,7 +525,19 @@ async function loadConfigFile(configFilePath, environment, logger = console) {
|
|
|
524
525
|
}
|
|
525
526
|
throw error;
|
|
526
527
|
}
|
|
527
|
-
|
|
528
|
+
let config;
|
|
529
|
+
try {
|
|
530
|
+
config = (await import(configFilePath)).default;
|
|
531
|
+
} catch (error) {
|
|
532
|
+
if (error instanceof Error && "code" in error && error.code === "ERR_UNKNOWN_FILE_EXTENSION") {
|
|
533
|
+
const extension = path.extname(configFilePath);
|
|
534
|
+
throw new TypeError(
|
|
535
|
+
`Your Happo config file ${configFilePath} is using an extension that is not supported by this version of Node.js (${extension}). Please use a newer version of Node.js (22.18.0+, 23.6.0+, or 24+).`,
|
|
536
|
+
{ cause: error }
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
throw error;
|
|
540
|
+
}
|
|
528
541
|
if (!config.apiKey && process.env.HAPPO_API_KEY) {
|
|
529
542
|
config.apiKey = process.env.HAPPO_API_KEY;
|
|
530
543
|
}
|
|
@@ -586,13 +599,13 @@ async function signRequest(apiKey, apiSecret) {
|
|
|
586
599
|
const encodedSecret = new TextEncoder().encode(apiSecret);
|
|
587
600
|
return await new SignJWT({ key: apiKey }).setProtectedHeader({ alg: "HS256", kid: apiKey }).sign(encodedSecret);
|
|
588
601
|
}
|
|
589
|
-
async function makeHappoAPIRequest({ url, path:
|
|
602
|
+
async function makeHappoAPIRequest({ url, path: path4, method = "GET", formData, body }, { apiKey, apiSecret, endpoint }, {
|
|
590
603
|
retryCount = 0,
|
|
591
604
|
timeout = 6e4,
|
|
592
605
|
retryMinTimeout = 1e3,
|
|
593
606
|
retryMaxTimeout = Infinity
|
|
594
607
|
}, logger = console) {
|
|
595
|
-
const fetchURL =
|
|
608
|
+
const fetchURL = path4 ? new URL(path4, endpoint) : url;
|
|
596
609
|
if (!fetchURL) {
|
|
597
610
|
throw new Error(
|
|
598
611
|
"No fetch URL provided. Either `path` (preferred) or `url` must be provided."
|
|
@@ -616,6 +629,9 @@ async function makeHappoAPIRequest({ url, path: path3, method = "GET", formData,
|
|
|
616
629
|
},
|
|
617
630
|
logger
|
|
618
631
|
);
|
|
632
|
+
if (response.status === 204) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
619
635
|
const result = await response.json();
|
|
620
636
|
if (typeof result !== "object") {
|
|
621
637
|
throw new TypeError(`Response is not an object: ${JSON.stringify(result)}`);
|
|
@@ -882,7 +898,7 @@ import mime from "mime-types";
|
|
|
882
898
|
|
|
883
899
|
// src/utils/deterministicArchive.ts
|
|
884
900
|
import fs3 from "node:fs";
|
|
885
|
-
import
|
|
901
|
+
import path2 from "node:path";
|
|
886
902
|
import { zip } from "fflate";
|
|
887
903
|
|
|
888
904
|
// src/utils/validateArchive.ts
|
|
@@ -913,7 +929,7 @@ function validateArchive(totalBytes, entries) {
|
|
|
913
929
|
// src/utils/deterministicArchive.ts
|
|
914
930
|
var FILE_CREATION_DATE = new Date(2019, 1, 8, 13, 31, 55);
|
|
915
931
|
async function resolveFilesRecursiveForDir(dirOrFile) {
|
|
916
|
-
const resolvedDirOrFile =
|
|
932
|
+
const resolvedDirOrFile = path2.resolve(dirOrFile);
|
|
917
933
|
const isDir = (await fs3.promises.lstat(resolvedDirOrFile)).isDirectory();
|
|
918
934
|
if (isDir) {
|
|
919
935
|
const fileEntries = [];
|
|
@@ -924,7 +940,7 @@ async function resolveFilesRecursiveForDir(dirOrFile) {
|
|
|
924
940
|
if (fileType.isFile()) {
|
|
925
941
|
const fullPath = `${fileType.parentPath}/${fileType.name}`;
|
|
926
942
|
fileEntries.push({
|
|
927
|
-
name:
|
|
943
|
+
name: path2.relative(resolvedDirOrFile, fullPath),
|
|
928
944
|
stream: fs3.createReadStream(fullPath)
|
|
929
945
|
});
|
|
930
946
|
}
|
|
@@ -933,7 +949,7 @@ async function resolveFilesRecursiveForDir(dirOrFile) {
|
|
|
933
949
|
}
|
|
934
950
|
return [
|
|
935
951
|
{
|
|
936
|
-
name:
|
|
952
|
+
name: path2.relative(process.cwd(), resolvedDirOrFile),
|
|
937
953
|
stream: fs3.createReadStream(resolvedDirOrFile)
|
|
938
954
|
}
|
|
939
955
|
];
|
|
@@ -1586,7 +1602,7 @@ Documentation:
|
|
|
1586
1602
|
var controller_default = Controller;
|
|
1587
1603
|
|
|
1588
1604
|
// src/playwright/index.ts
|
|
1589
|
-
var pathToBrowserBuild =
|
|
1605
|
+
var pathToBrowserBuild = path3.resolve(
|
|
1590
1606
|
import.meta.dirname,
|
|
1591
1607
|
"../../dist/browser/main.js"
|
|
1592
1608
|
);
|