@browsermation/test 0.0.38 → 0.0.40
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/bin/cli.js +1 -1
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -42258,7 +42258,7 @@ var {
|
|
|
42258
42258
|
// package.json
|
|
42259
42259
|
var package_default = {
|
|
42260
42260
|
name: "@browsermation/test",
|
|
42261
|
-
version: "0.0.
|
|
42261
|
+
version: "0.0.40",
|
|
42262
42262
|
description: "The testing platform for Playwright by Browsermation.",
|
|
42263
42263
|
main: "./dist/index.js",
|
|
42264
42264
|
types: "./dist/index.d.ts",
|
package/dist/index.js
CHANGED
|
@@ -626,16 +626,19 @@ async function fetchEndpoint() {
|
|
|
626
626
|
return reject(new Error(`HTTP status code ${res.statusCode} received`));
|
|
627
627
|
}
|
|
628
628
|
res.on("error", (err) => {
|
|
629
|
+
console.log("err", err);
|
|
629
630
|
console.error(
|
|
630
631
|
source_default.red.bold("\u274C Error: Failed to fetch WebSocket endpoint.")
|
|
631
632
|
);
|
|
632
633
|
reject(err);
|
|
633
634
|
});
|
|
634
635
|
res.on("data", async (chunk) => {
|
|
636
|
+
if (process.env.BM_DEBUG) {
|
|
637
|
+
console.log("Received chunk:", chunk.toString());
|
|
638
|
+
}
|
|
635
639
|
try {
|
|
636
|
-
const parsedData = JSON.parse(chunk.toString());
|
|
640
|
+
const parsedData = JSON.parse(chunk.toString().trim());
|
|
637
641
|
if (parsedData.type === "ws-endpoint") {
|
|
638
|
-
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
639
642
|
resolve(parsedData.wsEndpoint);
|
|
640
643
|
res.destroy();
|
|
641
644
|
}
|